Class SitecoreLayoutClientBuilderExtensions
Version: 21.x
Extension methods to support configuration of layout service services.
Inheritance
System.Object
SitecoreLayoutClientBuilderExtensions
Namespace: Sitecore.LayoutService.Client.Extensions
Assembly: Sitecore.LayoutService.Client.dll
Syntax
Methods
AddGraphQlHandler(ISitecoreLayoutClientBuilder, String, String, String, Uri)
Registers a graphQl handler to handle requests.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| ISitecoreLayoutClientBuilder | builder | The ISitecoreLayoutClientBuilder being configured. |
| System.String | name | The name used to identify the handler. |
| System.String | siteName | The siteName used to identify the handler. |
| System.String | apiKey | The apiKey to access graphQl endpoint. |
| System.Uri | uri | GraphQl endpoint uri. |
Returns
| Type | Description |
|---|---|
| ILayoutRequestHandlerBuilder < GraphQlLayoutServiceHandler > | The ILayoutRequestHandlerBuilder |
AddHandler(ISitecoreLayoutClientBuilder, String, Func<IServiceProvider, THandler>)
Registers a handler of type THandler to handle requests.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| ISitecoreLayoutClientBuilder | builder | The ISitecoreLayoutClientBuilder being configured. |
| System.String | name | The name used to identify the handler. |
| System.Func < System.IServiceProvider , THandler> | factory | Optional factory to control the instantiation of the client. |
Returns
| Type | Description |
|---|---|
| ILayoutRequestHandlerBuilder | The ILayoutRequestHandlerBuilder |
Type Parameters
| Name | Description |
|---|---|
| THandler | The type of service to be registered for this name. |
AddSystemTextJson(ISitecoreLayoutClientBuilder)
Configures System.Text.Json specific features such as input and output formatters.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| ISitecoreLayoutClientBuilder | builder | The ISitecoreLayoutClientBuilder being configured. |
Returns
| Type | Description |
|---|---|
| ISitecoreLayoutClientBuilder | The ILayoutRequestHandlerBuilder |
WithDefaultRequestOptions(ISitecoreLayoutClientBuilder, Action)
Registers the default layout service request options for all handlers.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| ISitecoreLayoutClientBuilder | builder | The ISitecoreLayoutClientBuilder being configured. |
| System.Action < SitecoreLayoutRequest > | configureRequest | The SitecoreLayoutRequest request options configuration. |
Returns
| Type | Description |
|---|---|
| ISitecoreLayoutClientBuilder | The configured ISitecoreLayoutClientBuilder. |
If you have suggestions for improving this article, let us know!