November Happy Hour will be moved to Thursday December 5th.

Class DefaultUrlSegmentRouter

Default IUrlSegmentRouter which resolves incoming/outgoing content for the request segment

Inheritance
System.Object
DefaultUrlSegmentRouter
Implements
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Web.Routing.Segments
Assembly: EPiServer.dll
Version: 9.12.2
Syntax
[ServiceConfiguration(typeof(IUrlSegmentRouter), FactoryMember = "Create")]
public class DefaultUrlSegmentRouter : IUrlSegmentRouter

Constructors

DefaultUrlSegmentRouter(IContentLoader, IRoutingSegmentLoader, AncestorReferencesLoader)

Initializes a new instance of the DefaultUrlSegmentRouter class.

Declaration
public DefaultUrlSegmentRouter(IContentLoader contentQueryable, IRoutingSegmentLoader routingSegmentLoader, AncestorReferencesLoader ancestorLoader)
Parameters
Type Name Description
IContentLoader contentQueryable

The content queryable.

IRoutingSegmentLoader routingSegmentLoader

The routing segment loader.

AncestorReferencesLoader ancestorLoader

The ancestor loader.

Properties

ContentLoader

Declaration
protected IContentLoader ContentLoader { get; set; }
Property Value
Type Description
IContentLoader

Root

The root node where url resolving starts

Declaration
[Obsolete("Use RootResolver instead")]
public ContentReference Root { get; }
Property Value
Type Description
ContentReference
Declaration
[Obsolete("Use RootResolver instead")]
protected ContentReference RootLink { get; }
Property Value
Type Description
ContentReference

RootResolver

Gets or sets the root resolver.

Declaration
public Func<SiteDefinition, ContentReference> RootResolver { get; set; }
Property Value
Type Description
System.Func<SiteDefinition, ContentReference>

The root resolver.

Methods

Create(IServiceLocator)

Creates an instance of DefaultUrlSegmentRouter.

Declaration
public static IUrlSegmentRouter Create(IServiceLocator locator)
Parameters
Type Name Description
IServiceLocator locator

The service locator used to fill constructor arguments.

Returns
Type Description
IUrlSegmentRouter

An instance of DefaultUrlSegmentRouter.

GetRoutingSegment(ContentReference, String)

Gets the routing specific data for a node.

Declaration
public virtual IRoutable GetRoutingSegment(ContentReference contentLink, string preferredLanguageBranch)
Parameters
Type Name Description
ContentReference contentLink

The content link.

System.String preferredLanguageBranch

The preferred language branch.

Returns
Type Description
IRoutable

IsContentUnderRoot(ContentReference)

Determines whether the specified contentLink is located under the Root for this router instance.

Declaration
public virtual bool IsContentUnderRoot(ContentReference contentLink)
Parameters
Type Name Description
ContentReference contentLink

The content link.

Returns
Type Description
System.Boolean

true the specified contentLink is located under the Root; otherwise, false.

ResolveContentForIncoming(ContentReference, String, SegmentContext)

Resolves the content for incoming.

Declaration
public virtual ContentReference ResolveContentForIncoming(ContentReference contentLink, string urlSegment, SegmentContext segmentContext)
Parameters
Type Name Description
ContentReference contentLink

The content link.

System.String urlSegment

The URL segment.

SegmentContext segmentContext

The segment context.

Returns
Type Description
ContentReference

ResolveContentForOutgoing(ContentReference)

Resolves the node representing the preceding url segment

Declaration
public virtual ContentReference ResolveContentForOutgoing(ContentReference contentLink)
Parameters
Type Name Description
ContentReference contentLink

The content link.

Returns
Type Description
ContentReference

Node representing the preceding url segment

Implements

Extension Methods