Class UmbracoVirtualPageRoute
This is used to setup the virtual page route so the route values and content are set for virtual pages.
Inheritance
Namespace: Umbraco.Cms.Web.Common.Routing
Assembly: Umbraco.Web.Common.dll
Syntax
public class UmbracoVirtualPageRoute : IUmbracoVirtualPageRoute
Constructors
View SourceUmbracoVirtualPageRoute(EndpointDataSource, LinkParser, UriUtility, IPublishedRouter)
Declaration
public UmbracoVirtualPageRoute(EndpointDataSource endpointDataSource, LinkParser linkParser, UriUtility uriUtility, IPublishedRouter publishedRouter)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.AspNetCore.Routing.EndpointDataSource | endpointDataSource | |
| Microsoft.AspNetCore.Routing.LinkParser | linkParser | |
| UriUtility | uriUtility | |
| IPublishedRouter | publishedRouter |
UmbracoVirtualPageRoute(EndpointDataSource, LinkParser, UriUtility, IPublishedRouter, IUmbracoContextAccessor)
Constructor.
Declaration
public UmbracoVirtualPageRoute(EndpointDataSource endpointDataSource, LinkParser linkParser, UriUtility uriUtility, IPublishedRouter publishedRouter, IUmbracoContextAccessor umbracoContextAccessor)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.AspNetCore.Routing.EndpointDataSource | endpointDataSource | The endpoint data source. |
| Microsoft.AspNetCore.Routing.LinkParser | linkParser | The link parser. |
| UriUtility | uriUtility | The Uri utility. |
| IPublishedRouter | publishedRouter | The published router. |
| IUmbracoContextAccessor | umbracoContextAccessor | The umbraco context accessor. |
Methods
View SourceCreatePublishedRequest(HttpContext, IPublishedContent)
Creates the published request for the published content.
Declaration
public async Task<IPublishedRequest> CreatePublishedRequest(HttpContext httpContext, IPublishedContent publishedContent)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.AspNetCore.Http.HttpContext | httpContext | The HTTP context. |
| IPublishedContent | publishedContent | The published content. |
Returns
| Type | Description |
|---|---|
| Task<IPublishedRequest> | The published request. |
FindContent(Endpoint, HttpContext, RouteValueDictionary, ControllerActionDescriptor, Object)
Finds the content from the custom route finder delegate or the virtual page controller. Note - This creates a dummay action executing context so the FindContent method of the IVirtualPageController can be called (without changing the interface contract).
Declaration
public IPublishedContent? FindContent(Endpoint endpoint, HttpContext httpContext, RouteValueDictionary routeValues, ControllerActionDescriptor controllerActionDescriptor, object controller)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.AspNetCore.Http.Endpoint | endpoint | The endpoint. |
| Microsoft.AspNetCore.Http.HttpContext | httpContext | The HTTP context. |
| Microsoft.AspNetCore.Routing.RouteValueDictionary | routeValues | The route values. |
| Microsoft.AspNetCore.Mvc.Controllers.ControllerActionDescriptor | controllerActionDescriptor | The action descriptor. |
| System.Object | controller | The controller. |
Returns
| Type | Description |
|---|---|
| System.Nullable<IPublishedContent> |
FindContent(Endpoint, ActionExecutingContext)
Finds the content from the custom route finder delegate or the virtual page controller.
Declaration
public IPublishedContent? FindContent(Endpoint endpoint, ActionExecutingContext actionExecutingContext)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.AspNetCore.Http.Endpoint | endpoint | The endpoint. |
| Microsoft.AspNetCore.Mvc.Filters.ActionExecutingContext | actionExecutingContext | The action executing context. |
Returns
| Type | Description |
|---|---|
| System.Nullable<IPublishedContent> | The published content if found or null. |
SetRouteValues(HttpContext, IPublishedContent, ControllerActionDescriptor)
Sets the route values for the published content and the controller action descriptor.
Declaration
public async Task SetRouteValues(HttpContext httpContext, IPublishedContent publishedContent, ControllerActionDescriptor controllerActionDescriptor)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.AspNetCore.Http.HttpContext | httpContext | The HTTP context. |
| IPublishedContent | publishedContent | The published content. |
| Microsoft.AspNetCore.Mvc.Controllers.ControllerActionDescriptor | controllerActionDescriptor | The controller action descriptor. |
Returns
| Type | Description |
|---|---|
| Task | Nothing. |
SetupVirtualPageRoute(HttpContext)
This sets up the virtual page route for the current request if a mtahcing endpoint is found.
Declaration
public async Task SetupVirtualPageRoute(HttpContext httpContext)
Parameters
| Type | Name | Description |
|---|---|---|
| Microsoft.AspNetCore.Http.HttpContext | httpContext | The HTTP context. |
Returns
| Type | Description |
|---|---|
| Task | Nothing |