Class SitecoreLayoutRequestExtensions
Extension methods for SitecoreLayoutRequest.
Inheritance
Namespace: Sitecore.LayoutService.Client.Request
Assembly: Sitecore.LayoutService.Client.Abstractions.dll
Syntax
public static class SitecoreLayoutRequestExtensions : Object
Methods
AddHeader(SitecoreLayoutRequest, String, String[])
Adds the header with key
and value
to the headers collection stored in layout request.
Declaration
public static void AddHeader(this SitecoreLayoutRequest layoutRequest, string key, string[] value)
Parameters
Type | Name | Description |
---|---|---|
SitecoreLayoutRequest | layoutRequest | Layout request instance. |
System.String | key | Header key. |
System.String[] | value | header value. |
AddHeaders(SitecoreLayoutRequest, IDictionary<String, String[]>)
Adds headers collection to the headers collection stored in layout request.
Declaration
public static void AddHeaders(this SitecoreLayoutRequest layoutRequest, IDictionary<string, string[]> headers)
Parameters
Type | Name | Description |
---|---|---|
SitecoreLayoutRequest | layoutRequest | Layout request instance. |
System.Collections.Generic.IDictionary<System.String, System.String[]> | headers | Headers collection. |
ApiKey(SitecoreLayoutRequest)
Gets the API key of the request.
Declaration
public static string ApiKey(this SitecoreLayoutRequest request)
Parameters
Type | Name | Description |
---|---|---|
SitecoreLayoutRequest | request |
Returns
Type | Description |
---|---|
System.String | The API key string value, otherwise null. |
ApiKey(SitecoreLayoutRequest, String)
Sets the API key of the request. If a null value is provided, the API key is removed from the request.
Declaration
public static SitecoreLayoutRequest ApiKey(this SitecoreLayoutRequest request, string value)
Parameters
Type | Name | Description |
---|---|---|
SitecoreLayoutRequest | request | |
System.String | value | The value to set. |
Returns
Type | Description |
---|---|
SitecoreLayoutRequest | The |
AuthenticationHeader(SitecoreLayoutRequest)
Sets the authentication header of the request. If a null value is provided, the authentication header is removed from the request.
Declaration
public static string AuthenticationHeader(this SitecoreLayoutRequest request)
Parameters
Type | Name | Description |
---|---|---|
SitecoreLayoutRequest | request |
Returns
Type | Description |
---|---|
System.String | The |
AuthenticationHeader(SitecoreLayoutRequest, String)
Gets the authentication header of the request.
Declaration
public static SitecoreLayoutRequest AuthenticationHeader(this SitecoreLayoutRequest request, string value)
Parameters
Type | Name | Description |
---|---|---|
SitecoreLayoutRequest | request | |
System.String | value | The value to set. |
Returns
Type | Description |
---|---|
SitecoreLayoutRequest | The authentication header string value, otherwise null. |
Language(SitecoreLayoutRequest)
Gets the language of the request.
Declaration
public static string Language(this SitecoreLayoutRequest request)
Parameters
Type | Name | Description |
---|---|---|
SitecoreLayoutRequest | request |
Returns
Type | Description |
---|---|
System.String | The language string value, otherwise null. |
Language(SitecoreLayoutRequest, String)
Sets the language of the request. If a null value is provided, the language is removed from the request.
Declaration
public static SitecoreLayoutRequest Language(this SitecoreLayoutRequest request, string value)
Parameters
Type | Name | Description |
---|---|---|
SitecoreLayoutRequest | request | |
System.String | value | The value to set. |
Returns
Type | Description |
---|---|
SitecoreLayoutRequest | The |
Mode(SitecoreLayoutRequest)
Gets the mode of the request.
Declaration
public static string Mode(this SitecoreLayoutRequest request)
Parameters
Type | Name | Description |
---|---|---|
SitecoreLayoutRequest | request |
Returns
Type | Description |
---|---|
System.String | The mode string value, otherwise null. |
Mode(SitecoreLayoutRequest, String)
Sets the mode of the request. If a null value is provided, the mode is removed from the request.
Declaration
public static SitecoreLayoutRequest Mode(this SitecoreLayoutRequest request, string value)
Parameters
Type | Name | Description |
---|---|---|
SitecoreLayoutRequest | request | |
System.String | value | The value to set. |
Returns
Type | Description |
---|---|
SitecoreLayoutRequest | The |
Path(SitecoreLayoutRequest)
Gets the path of the request.
Declaration
public static string Path(this SitecoreLayoutRequest request)
Parameters
Type | Name | Description |
---|---|---|
SitecoreLayoutRequest | request |
Returns
Type | Description |
---|---|
System.String | The path string value, otherwise null. |
Path(SitecoreLayoutRequest, String)
Sets the path of the request. If a null value is provided, the path is removed from the request.
Declaration
public static SitecoreLayoutRequest Path(this SitecoreLayoutRequest request, string value)
Parameters
Type | Name | Description |
---|---|---|
SitecoreLayoutRequest | request | |
System.String | value | The value to set. |
Returns
Type | Description |
---|---|
SitecoreLayoutRequest | The |
PreviewDate(SitecoreLayoutRequest)
Sets the preview date of the request. If a null value is provided, the preview date is removed from the request.
Declaration
public static string PreviewDate(this SitecoreLayoutRequest request)
Parameters
Type | Name | Description |
---|---|---|
SitecoreLayoutRequest | request |
Returns
Type | Description |
---|---|
System.String | The |
PreviewDate(SitecoreLayoutRequest, String)
Gets the preview date of the request.
Declaration
public static SitecoreLayoutRequest PreviewDate(this SitecoreLayoutRequest request, string value)
Parameters
Type | Name | Description |
---|---|---|
SitecoreLayoutRequest | request | |
System.String | value | The value to set. |
Returns
Type | Description |
---|---|
SitecoreLayoutRequest | The preview date string value, otherwise null. |
SiteName(SitecoreLayoutRequest)
Gets the site name of the request.
Declaration
public static string SiteName(this SitecoreLayoutRequest request)
Parameters
Type | Name | Description |
---|---|---|
SitecoreLayoutRequest | request |
Returns
Type | Description |
---|---|
System.String | The site name string value, otherwise null. |
SiteName(SitecoreLayoutRequest, String)
Sets the site name of the request. If a null value is provided, the site name is removed from the request.
Declaration
public static SitecoreLayoutRequest SiteName(this SitecoreLayoutRequest request, string value)
Parameters
Type | Name | Description |
---|---|---|
SitecoreLayoutRequest | request | |
System.String | value | The value to set. |
Returns
Type | Description |
---|---|
SitecoreLayoutRequest | The |
TryGetHeadersCollection(SitecoreLayoutRequest, out Dictionary<String, String[]>)
Tries to get headers collection from layout request.
Declaration
public static bool TryGetHeadersCollection(this SitecoreLayoutRequest layoutRequest, out Dictionary<string, string[]> headers)
Parameters
Type | Name | Description |
---|---|---|
SitecoreLayoutRequest | layoutRequest | Layout request instance. |
System.Collections.Generic.Dictionary<System.String, System.String[]> | headers | Headers. |
Returns
Type | Description |
---|---|
System.Boolean |
|
UpdateRequest(SitecoreLayoutRequest, Dictionary<String, Object>)
Update missing values in the original request with values in the default request.
Declaration
public static SitecoreLayoutRequest UpdateRequest(this SitecoreLayoutRequest request, Dictionary<string, object> requestDefaults)
Parameters
Type | Name | Description |
---|---|---|
SitecoreLayoutRequest | request | The original request object. |
System.Collections.Generic.Dictionary<System.String, System.Object> | requestDefaults | The default request object. |
Returns
Type | Description |
---|---|
SitecoreLayoutRequest | The updated request object. |