Class LayoutRequestHandlerBuilderExtensions
- Namespace
- Sitecore.AspNetCore.SDK.LayoutService.Client.Extensions
- Assembly
- Sitecore.AspNetCore.SDK.LayoutService.Client.dll
Extension methods to support configuration of Sitecore layout request handler services.
public static class LayoutRequestHandlerBuilderExtensions
- Inheritance
-
LayoutRequestHandlerBuilderExtensions
- Inherited Members
Methods
AsDefaultHandler<THandler>(ILayoutRequestHandlerBuilder<THandler>)
Sets the current handler being built as the default handler for Sitecore layout service client requests.
public static ILayoutRequestHandlerBuilder<THandler> AsDefaultHandler<THandler>(this ILayoutRequestHandlerBuilder<THandler> builder) where THandler : ILayoutRequestHandler
Parameters
builder
ILayoutRequestHandlerBuilder<THandler>The builder being configured.
Returns
- ILayoutRequestHandlerBuilder<THandler>
The configured ILayoutRequestHandlerBuilder<THandler>.
Type Parameters
THandler
The type of handler being configured.
ConfigureRequest(ILayoutRequestHandlerBuilder<HttpLayoutRequestHandler>, string[])
Adds default configuration for the HTTP request message.
public static ILayoutRequestHandlerBuilder<HttpLayoutRequestHandler> ConfigureRequest(this ILayoutRequestHandlerBuilder<HttpLayoutRequestHandler> httpHandlerBuilder, string[] nonValidatedHeaders)
Parameters
httpHandlerBuilder
ILayoutRequestHandlerBuilder<HttpLayoutRequestHandler>The ILayoutRequestHandlerBuilder<THandler> to configure.
nonValidatedHeaders
string[]The list of headers which should not be validated.
Returns
- ILayoutRequestHandlerBuilder<HttpLayoutRequestHandler>
The ILayoutRequestHandlerBuilder<THandler> so that additional calls can be chained.
MapFromRequest(ILayoutRequestHandlerBuilder<HttpLayoutRequestHandler>, Action<SitecoreLayoutRequest, HttpRequestMessage>)
Registers a HttpRequestMessage configuration action as named HttpLayoutRequestHandlerOptions for the given handler.
public static ILayoutRequestHandlerBuilder<HttpLayoutRequestHandler> MapFromRequest(this ILayoutRequestHandlerBuilder<HttpLayoutRequestHandler> builder, Action<SitecoreLayoutRequest, HttpRequestMessage> configureHttpRequestMessage)
Parameters
builder
ILayoutRequestHandlerBuilder<HttpLayoutRequestHandler>The ILayoutRequestHandlerBuilder<THandler> to configure.
configureHttpRequestMessage
Action<SitecoreLayoutRequest, HttpRequestMessage>The HttpRequestMessage configuration based on SitecoreLayoutRequest.
Returns
- ILayoutRequestHandlerBuilder<HttpLayoutRequestHandler>
The configured ILayoutRequestHandlerBuilder<THandler>.
WithRequestOptions<THandler>(ILayoutRequestHandlerBuilder<THandler>, Action<SitecoreLayoutRequest>)
Registers the default Sitecore layout service request options for the given handler.
public static ILayoutRequestHandlerBuilder<THandler> WithRequestOptions<THandler>(this ILayoutRequestHandlerBuilder<THandler> builder, Action<SitecoreLayoutRequest> configureRequest) where THandler : ILayoutRequestHandler
Parameters
builder
ILayoutRequestHandlerBuilder<THandler>The ILayoutRequestHandlerBuilder<THandler> being configured.
configureRequest
Action<SitecoreLayoutRequest>The SitecoreLayoutRequest request options configuration.
Returns
- ILayoutRequestHandlerBuilder<THandler>
The configured ILayoutRequestHandlerBuilder<THandler>.
Type Parameters
THandler
The type of handler being configured.