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

Class GuidSegment

Inheritance
System.Object
GuidSegment
Implements
Namespace: EPiServer.Web.Routing.Segments
Assembly: EPiServer.dll
Version: 9.12.2
Syntax
public class GuidSegment : NodeSegment, ISegment

Constructors

GuidSegment(String, String, IUrlSegmentRouter, IPermanentLinkMapper, RouteCollection, IContentLoader, UrlResolver, IContentLanguageSettingsHandler)

Initializes a new instance of the Node segment class.

Declaration
public GuidSegment(string name, string friendlyUrlExtension, IUrlSegmentRouter urlSegmentRouter, IPermanentLinkMapper permanentLinkMapper, RouteCollection routeCollection, IContentLoader contentLoader, UrlResolver urlResolver, IContentLanguageSettingsHandler contentSettingsLanguageHandler)
Parameters
Type Name Description
System.String name

Name of the segment.

System.String friendlyUrlExtension

he extension used for friendly URL generation.

IUrlSegmentRouter urlSegmentRouter

The router used when resolving nodes.

IPermanentLinkMapper permanentLinkMapper

The permanent link mapper.

System.Web.Routing.RouteCollection routeCollection

The route collection.

IContentLoader contentLoader

The content loader.

UrlResolver urlResolver

The URL resolver.

IContentLanguageSettingsHandler contentSettingsLanguageHandler

Content language settings handler to use

Properties

PreferredLanguageAccessor

Exposes the accessor used to get PreferredLanguage.

Declaration
public Func<string> PreferredLanguageAccessor { get; set; }
Property Value
Type Description
System.Func<System.String>

The preferred language accessor.

Remarks

This is primarly exposed to make it possible to change in unit tests. By default the value is set PreferredCulture.

Methods

RedirectionEnabled(RequestSegmentContext)

Declaration
protected override bool RedirectionEnabled(RequestSegmentContext context)
Parameters
Type Name Description
RequestSegmentContext context
Returns
Type Description
System.Boolean
Overrides

RouteDataMatch(SegmentContext)

Set the node, language and controller value to the segment context.

Declaration
public override bool RouteDataMatch(SegmentContext context)
Parameters
Type Name Description
SegmentContext context

The segment context

Returns
Type Description
System.Boolean

It will always return true.

Overrides

TryParse(String, out Guid)

Tries to parse the string to a guid by using Guid.TryParseExact(guidString, "N", out permanentGuid)

Declaration
protected virtual bool TryParse(string guidString, out Guid permanentGuid)
Parameters
Type Name Description
System.String guidString

The GUID string.

System.Guid permanentGuid

The permanent GUID.

Returns
Type Description
System.Boolean

True if parsed, otherwise false

Implements

Extension Methods