Class NewtonsoftFieldReader
Version: 21.x
Implements an IFieldReader for JSON data.
Implements
Inherited Members
Namespace: Sitecore.LayoutService.Client.Newtonsoft.Model
Assembly: Sitecore.LayoutService.Client.Newtonsoft.dll
Syntax
RequestResponse
public class NewtonsoftFieldReader : FieldReader, IFieldReaderConstructors
NewtonsoftFieldReader(JsonSerializer, JToken)
Initializes a new instance of the NewtonsoftFieldReader class.
Declaration
RequestResponse
public NewtonsoftFieldReader(JsonSerializer serializer, JToken json)Parameters
| Type | Name | Description |
|---|---|---|
| Newtonsoft.Json.JsonSerializer | serializer |
The serializer to use when reading. |
| Newtonsoft.Json.Linq.JToken | json |
The raw JSON data. |
Methods
HandleRead(Type)
Returns an instance of the Field data as a specified type.
Declaration
RequestResponse
protected override object HandleRead(Type type)Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | type |
The type to read the field as. |
Returns
| Type | Description |
|---|---|
| System.Object |
A new instance of the specified type. |