Class CachingUrlResolver

This type/member supports the EPiServer infrastructure and is not intended to be used directly from your code.

EPiServer.Web.Routing.UrlResolver wrapper, with an outgoing request cache. An underlying UrlResolver will be used to perform the resolving of the Url when items not in the cache.

Inheritance
System.Object
CachingUrlResolver
Namespace: EPiServer.Commerce.Routing.Internal
Assembly: EPiServer.Business.Commerce.dll
Version: 10.8.0
Syntax
public class CachingUrlResolver : UrlResolver

Constructors

CachingUrlResolver(UrlResolver, ServiceAccessor<HttpContextBase>)

Initializes a new instance of the CachingUrlResolver class.

Declaration
public CachingUrlResolver(UrlResolver defaultUrlResolver, ServiceAccessor<HttpContextBase> httpContextAccessor)
Parameters
Type Name Description
EPiServer.Web.Routing.UrlResolver defaultUrlResolver

The default URL resolver.

EPiServer.ServiceLocation.ServiceAccessor<System.Web.HttpContextBase> httpContextAccessor

The http context accessor

Methods

GetUrl(UrlBuilder, VirtualPathArguments)

Resolves the URL for an item from an URL with internal format. Delegates to the default EPiServer.Web.Routing.UrlResolver implementation supplied in the constructor.

Declaration
public override string GetUrl(UrlBuilder urlBuilderWithInternalUrl, VirtualPathArguments arguments)
Parameters
Type Name Description
EPiServer.UrlBuilder urlBuilderWithInternalUrl

The URL with a internal format.

EPiServer.Web.Routing.VirtualPathArguments arguments

The EPiServer.Web.Routing.VirtualPathArguments that determines the format of the link.

Returns
Type Description
System.String

A URL in string representation.

GetVirtualPath(ContentReference, String, VirtualPathArguments)

Tries to get the URL for a content and mode and returns a System.Web.Routing.VirtualPathData that contains the routing information. Uses the HttpContext, if available, as a per-request cache.

Declaration
public override VirtualPathData GetVirtualPath(ContentReference contentLink, string language, VirtualPathArguments arguments)
Parameters
Type Name Description
EPiServer.Core.ContentReference contentLink
System.String language
EPiServer.Web.Routing.VirtualPathArguments arguments
Returns
Type Description
System.Web.Routing.VirtualPathData

A virtual path or null if it was not possible to create a route to the content (for example the content does not exist or has no template)

GetVirtualPathForNonContent(Object, String, VirtualPathArguments)

Gets the virtual path for an object that is not an EPiServer.Core.IContent object but has been routed by a partial router.

Delegates to the default EPiServer.Web.Routing.UrlResolver implementation supplied in the constructor.

Declaration
public override VirtualPathData GetVirtualPathForNonContent(object partialRoutedObject, string language, VirtualPathArguments virtualPathArguments)
Parameters
Type Name Description
System.Object partialRoutedObject

The partial routed object.

System.String language

The language.

EPiServer.Web.Routing.VirtualPathArguments virtualPathArguments

The virtual path arguments.

Returns
Type Description
System.Web.Routing.VirtualPathData

Route(UrlBuilder, ContextMode)

Routes the URL to the corresponding EPiServer.Core.IContent instance. Delegates to the default EPiServer.Web.Routing.UrlResolver implementation supplied in the constructor.

Declaration
public override IContent Route(UrlBuilder urlBuilder, ContextMode contextMode)
Parameters
Type Name Description
EPiServer.UrlBuilder urlBuilder

The URL builder.

EPiServer.Web.ContextMode contextMode

The ContextMode

Returns
Type Description
EPiServer.Core.IContent

TryToPermanent(String, out String)

Tries to convert a URL with either a public, preview or permanent format to a permanent URL. Delegates to the default EPiServer.Web.Routing.UrlResolver implementation supplied in the constructor.

Declaration
public override bool TryToPermanent(string url, out string permanentUrl)
Parameters
Type Name Description
System.String url

The URL.

System.String permanentUrl

The permanent URL.

Returns
Type Description
System.Boolean

True if the conversion succeded, otherwise; false.