SaaS CMS has officially launched! Learn more now.

Class ContentUrlGeneratorExtensions

Extension methods for IContentUrlGenerator

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

Methods

Generate(IContentUrlGenerator, ContentReference)

Generates an url for a content instance.

Declaration
public static Uri Generate(this IContentUrlGenerator generateUrl, ContentReference contentLink)
Parameters
Type Name Description
IContentUrlGenerator generateUrl

The url generator that is extended

ContentReference contentLink

A reference for the content for which the url is to be generated

Returns
Type Description
System.Uri

The generated url or null if no url could be generated

Remarks

Language will be determined from request context.

Generate(IContentUrlGenerator, ContentReference, CultureInfo)

Generates an url for a content instance in the specified language

Declaration
public static Uri Generate(this IContentUrlGenerator generateUrl, ContentReference contentLink, CultureInfo language)
Parameters
Type Name Description
IContentUrlGenerator generateUrl

The url generator that is extended

ContentReference contentLink

A reference for the content for which the url is to be generated

System.Globalization.CultureInfo language

The language version to generate an url for

Returns
Type Description
System.Uri

The generated url or null if no url could be generated