Nucleus .Net Core CMS

Models.LocalPath Class

Namespace: Nucleus.Abstractions.Models
Assembly: Nucleus.Abstractions.dll
Provides an object representation of a the part of the request path that was not resolved to a page, and easy access to the parts of the path.

Remarks

Nucleus extensions do not create this object directly. Use the Context. LocalPath property to get a LocalPath instance.

Example

if (this.Context.LocalPath.Segments.Length == 1 && Guid.TryParse(this.Context.LocalPath.Segments.First(), out Guid productId)) 
{ 
  // if id is specified in the url, and is a guid, load content by id 
  // ... 
}

Constructor

Nucleus.Abstractions.Models.LocalPath Constructor

Nucleus.Abstractions.Models.LocalPath (String path)
Initializes a new instance of the LocalPath class.
Parameters
Name Type
path String
Remarks
Nucleus extensions do not use this contructor. The LocalPath property of the Models.Context class provides access to the local path.

Properties

HasValue Property

Returns whether this LocalPath instance has a value.

FullPath Property

Return the local path

Path Property

Gets the local path part of the specified absolute path (the part that does not contain the query)

Segments Property

Gets an array containing the path segments that make up the local path.

Methods

ToString

ToString ()
Gets a string representation for the specified Uri path (returns AbsolutePath).