Class NewtonsoftFieldReader

Version: 21.x

Implements an IFieldReader for JSON data.

Inheritance

System.Object

FieldReader

NewtonsoftFieldReader

Implements

IFieldReader

Inherited Members

FieldReader.Read()

FieldReader.TryRead(TField)

FieldReader.TryRead(Type, IField)

FieldReader.Read(Type)

Namespace: Sitecore.LayoutService.Client.Newtonsoft.Model
Assembly: Sitecore.LayoutService.Client.Newtonsoft.dll
Syntax
public class NewtonsoftFieldReader : FieldReader, IFieldReader

Constructors

NewtonsoftFieldReader(JsonSerializer, JToken)

Initializes a new instance of the NewtonsoftFieldReader class.

Declaration
public NewtonsoftFieldReader(JsonSerializer serializer, JToken json)
Parameters
TypeNameDescription
Newtonsoft.Json.JsonSerializerserializerThe serializer to use when reading.
Newtonsoft.Json.Linq.JTokenjsonThe raw JSON data.

Methods

HandleRead(Type)

Returns an instance of the Field data as a specified type.

Declaration
protected override object HandleRead(Type type)
Parameters
TypeNameDescription
System.TypetypeThe type to read the field as.
Returns
TypeDescription
System.ObjectA new instance of the specified type.
Overrides

FieldReader.HandleRead(Type)

Implements

IFieldReader

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