Class RequestCacheUrlResolver
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
Namespace: EPiServer.Commerce.Routing
Assembly: EPiServer.Business.Commerce.dll
Version: 10.8.0Syntax
[Obsolete("This class is no longer used. The replacement implementation is not public API. Will remain at least until October 2017.")]
public class RequestCacheUrlResolver : DefaultUrlResolver
Constructors
RequestCacheUrlResolver(RouteCollection, IContentLoader, LanguageSelectorFactory, SiteDefinitionRepository, TemplateResolver, IPermanentLinkMapper, ServiceAccessor<HttpContextBase>)
Declaration
[Obsolete("This constructor is not used due to changes in the base class. Use the constructor with IContentLanguageSettingsHandler parameter. Will remain at least until May 2017.")]
public RequestCacheUrlResolver(RouteCollection routes, IContentLoader contentLoader, LanguageSelectorFactory languageSelectorFactory, SiteDefinitionRepository siteDefinitionRepository, TemplateResolver templateResolver, IPermanentLinkMapper permanentLinkMapper, ServiceAccessor<HttpContextBase> httpContextAccessor)
Parameters
Type | Name | Description |
---|---|---|
System.Web.Routing.RouteCollection | routes | |
EPiServer.IContentLoader | contentLoader | |
EPiServer.Core.LanguageSelectorFactory | languageSelectorFactory | |
EPiServer.Web.SiteDefinitionRepository | siteDefinitionRepository | |
EPiServer.Web.TemplateResolver | templateResolver | |
EPiServer.Web.IPermanentLinkMapper | permanentLinkMapper | |
EPiServer.ServiceLocation.ServiceAccessor<System.Web.HttpContextBase> | httpContextAccessor |
RequestCacheUrlResolver(RouteCollection, IContentLoader, ISiteDefinitionRepository, TemplateResolver, IPermanentLinkMapper, IContentLanguageSettingsHandler, ServiceAccessor<HttpContextBase>)
Initializes a new instance of the RequestCacheUrlResolver class.
Declaration
public RequestCacheUrlResolver(RouteCollection routes, IContentLoader contentLoader, ISiteDefinitionRepository siteDefinitionRepository, TemplateResolver templateResolver, IPermanentLinkMapper permanentLinkMapper, IContentLanguageSettingsHandler contentLanguageSettingsHandler, ServiceAccessor<HttpContextBase> httpContextAccessor)
Parameters
Type | Name | Description |
---|---|---|
System.Web.Routing.RouteCollection | routes | The routes. |
EPiServer.IContentLoader | contentLoader | The content loader. |
EPiServer.Web.ISiteDefinitionRepository | siteDefinitionRepository | The site definition repository. |
EPiServer.Web.TemplateResolver | templateResolver | The template resolver. |
EPiServer.Web.IPermanentLinkMapper | permanentLinkMapper | The permanent link mapper. |
EPiServer.Core.IContentLanguageSettingsHandler | contentLanguageSettingsHandler | The content language settings handler. |
EPiServer.ServiceLocation.ServiceAccessor<System.Web.HttpContextBase> | httpContextAccessor | The http context accessor |
RequestCacheUrlResolver(RouteCollection, IContentLoader, SiteDefinitionRepository, TemplateResolver, IPermanentLinkMapper, IContentLanguageSettingsHandler, ServiceAccessor<HttpContextBase>)
Declaration
[Obsolete("This constructor is not used due to changes in the base class. Use the constructor with ISiteDefinitionRepository parameter. Will remain at least until September 2017.")]
public RequestCacheUrlResolver(RouteCollection routes, IContentLoader contentLoader, SiteDefinitionRepository siteDefinitionRepository, TemplateResolver templateResolver, IPermanentLinkMapper permanentLinkMapper, IContentLanguageSettingsHandler contentLanguageSettingsHandler, ServiceAccessor<HttpContextBase> httpContextAccessor)
Parameters
Type | Name | Description |
---|---|---|
System.Web.Routing.RouteCollection | routes | |
EPiServer.IContentLoader | contentLoader | |
EPiServer.Web.SiteDefinitionRepository | siteDefinitionRepository | |
EPiServer.Web.TemplateResolver | templateResolver | |
EPiServer.Web.IPermanentLinkMapper | permanentLinkMapper | |
EPiServer.Core.IContentLanguageSettingsHandler | contentLanguageSettingsHandler | |
EPiServer.ServiceLocation.ServiceAccessor<System.Web.HttpContextBase> | httpContextAccessor |
Methods
GetVirtualPath(ContentReference, String, ContextMode, Func<String>)
Gets the url for a EPiServer.Core.IContent instance that is given by reference contentLink
Declaration
[Obsolete("This method has a bug which cause route values are not cached properly. \r\n Use GetVirtualPath(ContentReference contentLink, string language, VirtualPathArguments virtualPathArguments, Func<string> getVirtualPathAction) instead\r\n Will remain at least until April 2016.")]
public string GetVirtualPath(ContentReference contentLink, string language, ContextMode contextMode, Func<string> getVirtualPathAction)
Parameters
Type | Name | Description |
---|---|---|
EPiServer.Core.ContentReference | contentLink | The content link. |
System.String | language | The language. |
EPiServer.Web.ContextMode | contextMode | The context mode. |
System.Func<System.String> | getVirtualPathAction | The action to perform when the item is not in the cache. The result from the action will be cached. |
Returns
Type | Description |
---|---|
System.String |
Remarks
This version uses a request cache to get the items.
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 |
GetVirtualPath(ContentReference, String, VirtualPathArguments, Func<String>)
Gets the url for a EPiServer.Core.IContent instance that is given by reference contentLink
Declaration
[Obsolete("This method is no longer used. It will just execute and return the result of getVirtualPathAction.\r\n Use the GetVirtualPath / GetUrl methods defined by UrlResolver with this class to get cached functionality.\r\n Will remain at least until October 2016.")]
public string GetVirtualPath(ContentReference contentLink, string language, VirtualPathArguments virtualPathArguments, Func<string> getVirtualPathAction)
Parameters
Type | Name | Description |
---|---|---|
EPiServer.Core.ContentReference | contentLink | The content. |
System.String | language | The language. |
EPiServer.Web.Routing.VirtualPathArguments | virtualPathArguments | The virtual path arguments. |
System.Func<System.String> | getVirtualPathAction | The action to perform when the item is not in the cache. The result from the action will be cached. |
Returns
Type | Description |
---|---|
System.String |
Remarks
This version uses a request cache to get the items.
GetVirtualPathInternal(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
protected virtual VirtualPathData GetVirtualPathInternal(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 |
ResolveVirtualPath(ContentReference, String, VirtualPathArguments)
Resolves the virtual path. This implementation uses DefaultUrlResolver.GetVirtualPathInternal
Declaration
protected virtual VirtualPathData ResolveVirtualPath(ContentReference contentLink, string language, VirtualPathArguments arguments)
Parameters
Type | Name | Description |
---|---|---|
EPiServer.Core.ContentReference | contentLink | The content link. |
System.String | language | The language. |
EPiServer.Web.Routing.VirtualPathArguments | arguments | The arguments. |
Returns
Type | Description |
---|---|
System.Web.Routing.VirtualPathData |