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.
Nucleus extensions do not create this object directly. Use the Context. LocalPath property to get a LocalPath instance.
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 
  // ... 
}
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.
Return the local path
Returns whether this LocalPath instance has a value.
Gets the local path part of the specified absolute path (the part that does not contain the query)
Gets an array containing the path segments that make up the local path.
ToString ()
Gets a string representation for the specified Uri path (returns AbsolutePath).