Class PublishedRouter
Provides the default IPublishedRouter implementation.
Inheritance
Namespace: Umbraco.Cms.Core.Routing
Assembly: Umbraco.Core.dll
Syntax
public class PublishedRouter : IPublishedRouter
Constructors
View SourcePublishedRouter(IOptionsMonitor<WebRoutingSettings>, ContentFinderCollection, IContentLastChanceFinder, IVariationContextAccessor, IProfilingLogger, ILogger<PublishedRouter>, IPublishedUrlProvider, IRequestAccessor, IPublishedValueFallback, IFileService, IContentTypeService, IUmbracoContextAccessor, IEventAggregator)
Initializes a new instance of the PublishedRouter class.
Declaration
public PublishedRouter(IOptionsMonitor<WebRoutingSettings> webRoutingSettings, ContentFinderCollection contentFinders, IContentLastChanceFinder contentLastChanceFinder, IVariationContextAccessor variationContextAccessor, IProfilingLogger proflog, ILogger<PublishedRouter> logger, IPublishedUrlProvider publishedUrlProvider, IRequestAccessor requestAccessor, IPublishedValueFallback publishedValueFallback, IFileService fileService, IContentTypeService contentTypeService, IUmbracoContextAccessor umbracoContextAccessor, IEventAggregator eventAggregator)
Parameters
Type | Name | Description |
---|---|---|
IOptionsMonitor<WebRoutingSettings> | webRoutingSettings | |
ContentFinderCollection | contentFinders | |
IContentLastChanceFinder | contentLastChanceFinder | |
IVariationContextAccessor | variationContextAccessor | |
IProfilingLogger | proflog | |
ILogger<PublishedRouter> | logger | |
IPublishedUrlProvider | publishedUrlProvider | |
IRequestAccessor | requestAccessor | |
IPublishedValueFallback | publishedValueFallback | |
IFileService | fileService | |
IContentTypeService | contentTypeService | |
IUmbracoContextAccessor | umbracoContextAccessor | |
IEventAggregator | eventAggregator |
Methods
View SourceCreateRequestAsync(Uri)
Creates a published request.
Declaration
public async Task<IPublishedRequestBuilder> CreateRequestAsync(Uri uri)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | The current request Uri. |
Returns
Type | Description |
---|---|
Task<IPublishedRequestBuilder> | A published request builder. |
RouteRequestAsync(IPublishedRequestBuilder, RouteRequestOptions)
Sends a IPublishedRequestBuilder through the routing pipeline and builds a result.
Declaration
public async Task<IPublishedRequest> RouteRequestAsync(IPublishedRequestBuilder builder, RouteRequestOptions options)
Parameters
Type | Name | Description |
---|---|---|
IPublishedRequestBuilder | builder | |
RouteRequestOptions | options | The options. |
Returns
Type | Description |
---|---|
Task<IPublishedRequest> | The built IPublishedRequest instance. |
UpdateRequestAsync(IPublishedRequest, IPublishedContent)
Updates the request to use the specified IPublishedContent item, or NULL
Declaration
public async Task<IPublishedRequest> UpdateRequestAsync(IPublishedRequest request, IPublishedContent publishedContent)
Parameters
Type | Name | Description |
---|---|---|
IPublishedRequest | request | The request. |
IPublishedContent | publishedContent | The published content. |
Returns
Type | Description |
---|---|
Task<IPublishedRequest> |
Remarks
This method is used for 2 cases:
- When the rendering content needs to change due to Public Access rules.
- When there is nothing to render due to circumstances such as no template files. In this case, NULL is used as the parameter.
This method is invoked when the pipeline decides it cannot render the request, for whatever reason, and wants to force it to be re-routed and rendered as if no document were found (404). This occurs if there is no template found and route hijacking was not matched. In that case it's the same as if there was no content which means even if there was content matched we want to run the request through the last chance finders.