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
trueif 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
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
Return number of visits of current 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
idintThe id.
Delete(int[])
Deletes items specified by array of their IDs.
public static void Delete(int[] ids)
Parameters
idsint[]Item IDs to delete.
GetAllPaths()
Gets all paths.
public static IEnumerable<Path> GetAllPaths()
Returns
GetPathById(int)
Gets the path by ID.
public static Path? GetPathById(int id)
Parameters
idintThe path ID.
Returns
GetPathByUrl(string)
Gets the path by URL.
public static Path? GetPathByUrl(string urlPath)
Parameters
urlPathstringThe URL path.
Returns
GetPathsByArea(int)
Retrieves top 1000 paths defined for a given area.
public static IEnumerable<Path> GetPathsByArea(int areaID)
Parameters
areaIDintAn 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
pageIdintThe page ID.
Returns
GetPathsByPageIds(int[])
Gets the paths by page ids.
public static Dictionary<int, List<Path>> GetPathsByPageIds(int[] pageIds)
Parameters
pageIdsint[]The page IDs.
Returns
- Dictionary<int, List<Path>>
GetPathsByPath()
Gets all paths ordered by the path.
public static IEnumerable<Path> GetPathsByPath()
Returns
GetPathsByPath(SortBy, SortDirection)
Retrieves top 1000 paths.
public static IEnumerable<Path> GetPathsByPath(SortBy sortBy, SortDirection sortDirection)
Parameters
sortBySortByThe field to sort items by.
sortDirectionSortDirectionDirection of sorting.
Returns
- IEnumerable<Path>
Top 1000 paths.
GetPathsByUrl(string)
Gets the paths by URL.
public static IEnumerable<Path> GetPathsByUrl(string urlPath)
Parameters
urlPathstringThe URL path.
Returns
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
pathstringThe path.
Returns
PhysicallyExists(string)
Gets a value indicating whether path physically exists.
public static bool PhysicallyExists(string path)
Parameters
pathstringThe path
Returns
- bool
trueif 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
SetActiveState(int[], bool)
Switches items specified by array of their IDs active/inactive state.
public static void SetActiveState(int[] ids, bool state)