Table of Contents

Class DefaultLayoutClient

Namespace
Sitecore.AspNetCore.SDK.LayoutService.Client
Assembly
Sitecore.AspNetCore.SDK.LayoutService.Client.dll

Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.

public class DefaultLayoutClient : ISitecoreLayoutClient, ILayoutRequestHandler
Inheritance
DefaultLayoutClient
Implements
Inherited Members

Constructors

DefaultLayoutClient(IServiceProvider, IOptions<SitecoreLayoutClientOptions>, IOptionsSnapshot<SitecoreLayoutRequestOptions>, ILogger<DefaultLayoutClient>)

Initializes a new instance of the DefaultLayoutClient class.

public DefaultLayoutClient(IServiceProvider services, IOptions<SitecoreLayoutClientOptions> layoutClientOptions, IOptionsSnapshot<SitecoreLayoutRequestOptions> layoutRequestOptions, ILogger<DefaultLayoutClient> logger)

Parameters

services IServiceProvider

The services used for handler resolution.

layoutClientOptions IOptions<SitecoreLayoutClientOptions>

The SitecoreLayoutClientOptions for this instance.

layoutRequestOptions IOptionsSnapshot<SitecoreLayoutRequestOptions>

An IOptionsSnapshot<TOptions> to access specific options for the default client request.

logger ILogger<DefaultLayoutClient>

The ILogger to use for logging.

Methods

Request(SitecoreLayoutRequest)

Invokes a request to the Sitecore layout service using the default handler name.

public Task<SitecoreLayoutResponse> Request(SitecoreLayoutRequest request)

Parameters

request SitecoreLayoutRequest

The request details.

Returns

Task<SitecoreLayoutResponse>

The response of the request.

Request(SitecoreLayoutRequest, string)

Handles a request to the Sitecore layout service using the specified handler.

public Task<SitecoreLayoutResponse> Request(SitecoreLayoutRequest request, string handlerName)

Parameters

request SitecoreLayoutRequest

The request details.

handlerName string

The name of the request handler to use to handle the request.

Returns

Task<SitecoreLayoutResponse>

The response of the request.