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

Class UrlGeneratorOptionsExtensions

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Extension methods for UrlGeneratorOptions

Inheritance
System.Object
UrlGeneratorOptionsExtensions
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.Core.Routing.Internal
Assembly: EPiServer.dll
Version: 11.20.7
Syntax
public static class UrlGeneratorOptionsExtensions

Methods

GetContextMode(UrlGeneratorOptions)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Gets a context mode option that determines the format of the generated link

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

The options container that is extended

Returns
Type Description
ContextMode

The context mode option or null if it does not exist

GetCurrentHost(UrlGeneratorOptions)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Gets the host option that will be used as current host, used for example for generating relative URL's

Declaration
public static string GetCurrentHost(this UrlGeneratorOptions options)
Parameters
Type Name Description
UrlGeneratorOptions options

The options container that is extended

Returns
Type Description
System.String

The host option or null if it does not exist

Remarks

This option overrides any automatic detection of the current host.

GetForceAbsoluteUrl(UrlGeneratorOptions)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Gets an option that forces absolute URLs

Declaration
public static bool GetForceAbsoluteUrl(this UrlGeneratorOptions options)
Parameters
Type Name Description
UrlGeneratorOptions options

The options container that is extended

Returns
Type Description
System.Boolean

The value or false if not specified

GetForceCanonicalUrl(UrlGeneratorOptions)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Gets an option that forces absolute URLs

Declaration
public static bool GetForceCanonicalUrl(this UrlGeneratorOptions options)
Parameters
Type Name Description
UrlGeneratorOptions options

The options container that is extended

Returns
Type Description
System.Boolean

The value or false if not specified

GetLanguage(UrlGeneratorOptions)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Sets the language option that will determine the language of the link to generate

Declaration
public static CultureInfo GetLanguage(this UrlGeneratorOptions options)
Parameters
Type Name Description
UrlGeneratorOptions options

The options container that is extended

Returns
Type Description
System.Globalization.CultureInfo

The language option or null if it does not exist

SetContextMode(UrlGeneratorOptions, ContextMode)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Sets a context mode option that determines the format of the generated link

Declaration
public static UrlGeneratorOptions SetContextMode(this UrlGeneratorOptions options, ContextMode mode)
Parameters
Type Name Description
UrlGeneratorOptions options

The options container that is extended

ContextMode mode

The context mode to set

Returns
Type Description
UrlGeneratorOptions

The options container

SetCurrentHost(UrlGeneratorOptions, String)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Sets a host option that will be used as "current host", used for example for generating relative URL's

Declaration
public static UrlGeneratorOptions SetCurrentHost(this UrlGeneratorOptions options, string host)
Parameters
Type Name Description
UrlGeneratorOptions options

The options container that is extended

System.String host

The host to set

Returns
Type Description
UrlGeneratorOptions

The options container

Remarks

This option overrides any automatic detection of the current host.

SetForceAbsoluteUrl(UrlGeneratorOptions, Boolean)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Sets an option that forces absolute URLs

Declaration
public static UrlGeneratorOptions SetForceAbsoluteUrl(this UrlGeneratorOptions options, bool value = true)
Parameters
Type Name Description
UrlGeneratorOptions options

The options container that is extended

System.Boolean value

The value to set

Returns
Type Description
UrlGeneratorOptions

The options container

Remarks

It is not possible to generate absolute URL's for content outside a site unless there is a current host (use SetCurrentHost for rendering outside a web request)

SetForceCanonicalUrl(UrlGeneratorOptions, Boolean)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Sets an option that forces the use of the canonical URL

Declaration
public static UrlGeneratorOptions SetForceCanonicalUrl(this UrlGeneratorOptions options, bool value = true)
Parameters
Type Name Description
UrlGeneratorOptions options

The options container that is extended

System.Boolean value

Specifies if the url should be generated as a canonical url

Returns
Type Description
UrlGeneratorOptions

The options container

SetLanguage(UrlGeneratorOptions, CultureInfo)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Sets a language option that will determine the language of the link to generate

Declaration
public static UrlGeneratorOptions SetLanguage(this UrlGeneratorOptions options, CultureInfo language)
Parameters
Type Name Description
UrlGeneratorOptions options

The options container that is extended

System.Globalization.CultureInfo language

The language to set

Returns
Type Description
UrlGeneratorOptions

The options container