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

Class UrlResolverOptionsExtensions

Extension methods for UrlResolverOptions

Inheritance
System.Object
UrlResolverOptionsExtensions
Namespace: EPiServer.Core.Routing.Internal
Assembly: EPiServer.dll
Version: 12.0.3
Syntax
public static class UrlResolverOptionsExtensions : Object

Methods

GetConsumeNonContentPath(UrlResolverOptions)

SGts an option if see RemainingPath should consume path for none content partial routed segments

Declaration
public static bool GetConsumeNonContentPath(this UrlResolverOptions options)
Parameters
Type Name Description
UrlResolverOptions options

The options container that is extended

Returns
Type Description
System.Boolean

The specified option or true if it does not exist

GetContextMode(UrlResolverOptions)

Gets the ContextMode to resolve url for or default value Undefined if not configured

Declaration
public static ContextMode GetContextMode(this UrlResolverOptions options)
Parameters
Type Name Description
UrlResolverOptions options

The options container that is extended

Returns
Type Description
ContextMode

The options container

GetDefaultHost(UrlResolverOptions)

Gets the host option that will be used as default for relative URL's

Declaration
public static HostDefinition GetDefaultHost(this UrlResolverOptions options)
Parameters
Type Name Description
UrlResolverOptions options

The options container that is extended

Returns
Type Description
HostDefinition

The host option or null if it does not exist

GetExactMatch(UrlResolverOptions)

Gets the exact match option that is configured or default value (true) if not configured

Declaration
public static bool GetExactMatch(this UrlResolverOptions options)
Parameters
Type Name Description
UrlResolverOptions options

The options container that is extended

Returns
Type Description
System.Boolean

The options container

GetFallbackToWildcardHost(UrlResolverOptions)

Gets an option if wildcard host should be used as fallback after trying to find a matching host and site

Declaration
public static bool GetFallbackToWildcardHost(this UrlResolverOptions options)
Parameters
Type Name Description
UrlResolverOptions options

The options container that is extended

Returns
Type Description
System.Boolean

The wildcard host option or false if it does not exist

SetConsumeNonContentPath(UrlResolverOptions, Boolean)

Sets an option if see RemainingPath should consume path for none content partial routed segments

Declaration
public static UrlResolverOptions SetConsumeNonContentPath(this UrlResolverOptions options, bool consumeNoneContentPath)
Parameters
Type Name Description
UrlResolverOptions options

The options container that is extended

System.Boolean consumeNoneContentPath

Specifies if none content partial routed segements should be consumed

Returns
Type Description
UrlResolverOptions

The options container

SetContextMode(UrlResolverOptions, ContextMode)

Sets an option if the url should be resolved for a specific ContextMode

Declaration
public static UrlResolverOptions SetContextMode(this UrlResolverOptions options, ContextMode contextMode)
Parameters
Type Name Description
UrlResolverOptions options

The options container that is extended

ContextMode contextMode

The context mode to resolve the url for

Returns
Type Description
UrlResolverOptions

The options container

SetDefaultHost(UrlResolverOptions, HostDefinition)

Sets a host option that will be used as default for relative URL's

Declaration
public static UrlResolverOptions SetDefaultHost(this UrlResolverOptions options, HostDefinition host)
Parameters
Type Name Description
UrlResolverOptions options

The options container that is extended

HostDefinition host

The host to set

Returns
Type Description
UrlResolverOptions

The options container

Remarks

The resolver defaults to the current HTTP request if no default host is specified

SetExactMatch(UrlResolverOptions, Boolean)

Sets an option if the url should be matched exact or if it should route as far as possible with a possible remaining path

Declaration
public static UrlResolverOptions SetExactMatch(this UrlResolverOptions options, bool exactMatch = true)
Parameters
Type Name Description
UrlResolverOptions options

The options container that is extended

System.Boolean exactMatch

If the url must match exact or not

Returns
Type Description
UrlResolverOptions

The options container

SetFallbackToWildcardHost(UrlResolverOptions, Boolean)

Sets an option if wildcard host should be used as fallback after trying to find a matching host and site

Declaration
public static UrlResolverOptions SetFallbackToWildcardHost(this UrlResolverOptions options, bool fallbackToWildcard = true)
Parameters
Type Name Description
UrlResolverOptions options

The options container that is extended

System.Boolean fallbackToWildcard

The wildcard option to set

Returns
Type Description
UrlResolverOptions

The options container

Remarks

If no wilcard host exists this setting has no effect on the URL resolver