View Source
Class AspNetCoreRequestAccessor
Inheritance
System.Object
Assembly: Umbraco.Web.Common.dll
Syntax
public class AspNetCoreRequestAccessor : IRequestAccessor, INotificationHandler<UmbracoRequestBeginNotification>
Constructors
View Source
AspNetCoreRequestAccessor(IHttpContextAccessor, IOptions<WebRoutingSettings>)
Declaration
public AspNetCoreRequestAccessor(IHttpContextAccessor httpContextAccessor, IOptions<WebRoutingSettings> webRoutingSettings)
Parameters
| Type |
Name |
Description |
| Microsoft.AspNetCore.Http.IHttpContextAccessor |
httpContextAccessor |
|
| Microsoft.Extensions.Options.IOptions<WebRoutingSettings> |
webRoutingSettings |
|
Methods
View Source
GetApplicationUrl()
Declaration
public Uri GetApplicationUrl()
Returns
| Type |
Description |
| System.Uri |
|
View Source
GetQueryStringValue(String)
Declaration
public string GetQueryStringValue(string name)
Parameters
| Type |
Name |
Description |
| System.String |
name |
|
Returns
| Type |
Description |
| System.String |
|
View Source
GetRequestUrl()
Declaration
public Uri GetRequestUrl()
Returns
| Type |
Description |
| System.Uri |
|
View Source
GetRequestValue(String)
Declaration
public string GetRequestValue(string name)
Parameters
| Type |
Name |
Description |
| System.String |
name |
|
Returns
| Type |
Description |
| System.String |
|
View Source
Handle(UmbracoRequestBeginNotification)
This just initializes the application URL on first request attempt
TODO: This doesn't belong here, the GetApplicationUrl doesn't belong to IRequestAccessor
this should be part of middleware not a lazy init based on an INotification
Declaration
public void Handle(UmbracoRequestBeginNotification notification)
Parameters