Class DefaultLayoutClient
Supports making requests to the Sitecore layout service.
Inheritance
Namespace: Sitecore.LayoutService.Client
Assembly: Sitecore.LayoutService.Client.dll
Syntax
public class DefaultLayoutClient : Object, ISitecoreLayoutClient, ILayoutRequestHandlerConstructors
DefaultLayoutClient(IServiceProvider, IOptions<SitecoreLayoutClientOptions>, IOptionsSnapshot<SitecoreLayoutRequestOptions>, ILogger<DefaultLayoutClient>)
Initializes a new instance of the DefaultLayoutClient class.
Declaration
public DefaultLayoutClient(IServiceProvider services, IOptions<SitecoreLayoutClientOptions> layoutClientOptions, IOptionsSnapshot<SitecoreLayoutRequestOptions> layoutRequestOptions, ILogger<DefaultLayoutClient> logger)Parameters
| Type | Name | Description |
|---|---|---|
| System.IServiceProvider | services |
The services used for handler resolution. |
| Microsoft.Extensions.Options.IOptions<SitecoreLayoutClientOptions> | layoutClientOptions |
The SitecoreLayoutClientOptions for this instance. |
| Microsoft.Extensions.Options.IOptionsSnapshot<SitecoreLayoutRequestOptions> | layoutRequestOptions |
An Microsoft.Extensions.Options.IOptionsSnapshot<> to access specific options for the default client request. |
| Microsoft.Extensions.Logging.ILogger<DefaultLayoutClient> | logger |
The Microsoft.Extensions.Logging.ILogger to use for logging. |
Methods
Request(SitecoreLayoutRequest)
Invokes a request to the Sitecore layout service using the default handler name.
Declaration
public Task<SitecoreLayoutResponse> Request(SitecoreLayoutRequest request)Parameters
| Type | Name | Description |
|---|---|---|
| SitecoreLayoutRequest | request |
The request details. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<SitecoreLayoutResponse> |
The response of the request. |
Request(SitecoreLayoutRequest, String)
Handles a request to the Sitecore layout service using the specified handler.
Declaration
public Task<SitecoreLayoutResponse> Request(SitecoreLayoutRequest request, string handlerName)Parameters
| Type | Name | Description |
|---|---|---|
| SitecoreLayoutRequest | request |
The request details. |
| System.String | handlerName |
The name of the request handler to use to handle the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<SitecoreLayoutResponse> |
The response of the request. |