Table of Contents

Class Path

Namespace
Dynamicweb.Frontend.DirectPath
Assembly
Dynamicweb.dll

Defines a virtual path mapping. I.e. /Contact -> /Default.aspx?ID=123

public class Path : PathBase
Inheritance
Path
Inherited Members

Constructors

Path()

Initializes a new instance of the Path class.

public Path()

Properties

Active

Gets or sets a value indicating whether this Path is active.

public bool Active { get; set; }

Property Value

bool

true if active; otherwise, false.

AreaID

Gets or sets an ID of the language are that this path is defined for.

public int AreaID { get; set; }

Property Value

int

Created

Gets or sets the created time.

public DateTime Created { get; set; }

Property Value

DateTime

The created time.

ID

Gets or sets the ID.

public int ID { get; set; }

Property Value

int

The ID.

Redirect

Gets or sets the redirect. I.e. Default.aspx?ID=123

public required string Redirect { get; set; }

Property Value

string

The redirect.

Updated

Gets or sets the updated time.

public DateTime Updated { get; set; }

Property Value

DateTime

The updated time.

VisitsCount

Returnt count of visits of curernt path

public int VisitsCount { get; }

Property Value

int

Integer count of path visits

Methods

Delete()

Deletes this instance.

public void Delete()

Delete(int)

Deletes the path with the specified id.

public static void Delete(int id)

Parameters

id int

The id.

Delete(int[])

Deletes items specified by array of their IDs.

public static void Delete(int[] ids)

Parameters

ids int[]

Item IDs to delete.

GetAllPaths()

Gets all paths.

public static IEnumerable<Path> GetAllPaths()

Returns

IEnumerable<Path>

GetPathById(int)

Gets the path by ID.

public static Path? GetPathById(int id)

Parameters

id int

The path ID.

Returns

Path

GetPathByUrl(string)

Gets the path by URL.

public static Path? GetPathByUrl(string urlPath)

Parameters

urlPath string

The URL path.

Returns

Path

GetPathsByArea(int)

Retrieves top 1000 paths defined for a given area.

public static IEnumerable<Path> GetPathsByArea(int areaID)

Parameters

areaID int

An ID of the area to filter results by.

Returns

IEnumerable<Path>

Matched items or empty collection if nothing found.

GetPathsByPage(int)

Gets the paths by page.

public static IEnumerable<Path> GetPathsByPage(int pageId)

Parameters

pageId int

The page ID.

Returns

IEnumerable<Path>

GetPathsByPageIds(int[])

Gets the paths by page ids.

public static Dictionary<int, List<Path>> GetPathsByPageIds(int[] pageIds)

Parameters

pageIds int[]

The page IDs.

Returns

Dictionary<int, List<Path>>

GetPathsByPath()

Gets all paths ordered by the path.

public static IEnumerable<Path> GetPathsByPath()

Returns

IEnumerable<Path>

GetPathsByPath(SortBy, SortDirection)

Retrieves top 1000 paths.

public static IEnumerable<Path> GetPathsByPath(SortBy sortBy, SortDirection sortDirection)

Parameters

sortBy SortBy

The field to sort items by.

sortDirection SortDirection

Direction of sorting.

Returns

IEnumerable<Path>

Top 1000 paths.

GetPathsByUrl(string)

Gets the paths by URL.

public static IEnumerable<Path> GetPathsByUrl(string urlPath)

Parameters

urlPath string

The URL path.

Returns

IEnumerable<Path>

IncrementVisitsCount()

Increments visit counts of path by 1

public void IncrementVisitsCount()

Remarks

If field value is NULL it will be set to 1

PathExists(string)

Gets a value indicating whether path exists in database.

public static bool PathExists(string path)

Parameters

path string

The path.

Returns

bool

PhysicallyExists(string)

Gets a value indicating whether path physically exists.

public static bool PhysicallyExists(string path)

Parameters

path string

The path

Returns

bool

true if path physically exists; otherwise, false.

Remarks

Checks if the path exists on the file system

Save()

Saves this instance.

public void Save()

SetActiveState(int, bool)

Sets the active state of the instance.

public static void SetActiveState(int id, bool state)

Parameters

id int

The id.

state bool

if set to true active.

SetActiveState(int[], bool)

Switches items specified by array of their IDs active/inactive state.

public static void SetActiveState(int[] ids, bool state)

Parameters

ids int[]

Item IDs to process.

state bool

Value indicating whether items are active.

To top