Class NewtonsoftLayoutServiceSerializer

Version: 21.x

Handles JSON serialization for the Sitecore layout service.

Inheritance

System.Object

NewtonsoftLayoutServiceSerializer

Implements

ISitecoreLayoutSerializer

Namespace: Sitecore.LayoutService.Client.Newtonsoft

Assembly: Sitecore.LayoutService.Client.Newtonsoft.dll
Syntax
public class NewtonsoftLayoutServiceSerializer : Object, ISitecoreLayoutSerializer

Constructors

NewtonsoftLayoutServiceSerializer()

Declaration
public NewtonsoftLayoutServiceSerializer()

Methods

CreateSerializerSettings()

Gets the default settings for the JSON serializer.

Declaration
public static JsonSerializerSettings CreateSerializerSettings()
Returns
TypeDescription
Newtonsoft.Json.JsonSerializerSettingsAn instance of Newtonsoft.Json.JsonSerializerSettings with all serialization defaults for the Sitecore layout service.

Deserialize(String)

Deserializes the given data to a SitecoreLayoutResponseContent.

Declaration
public SitecoreLayoutResponseContent Deserialize(string data)
Parameters
TypeNameDescription
System.StringdataThe data to deserialize.
Returns
TypeDescription
SitecoreLayoutResponseContentThe deserialized SitecoreLayoutResponseContent.

Implements

ISitecoreLayoutSerializer

If you have suggestions for improving this article, let us know!