Share via


JsonExtensions.ReadObject Method

Definition

Overloads

ReadObject(JsonReader, IEnumerable<String>, Action<JsonReader,String>)

Reads the properties of JSON objects, enforcing the presence of required properties and ignoring the order of properties.

ReadObject(JsonReader, IEnumerable<String>, IEnumerable<String>, Action<JsonReader,String>)

Reads the properties of JSON objects, enforcing the presence of required properties and ignoring the order of properties.

ReadObject(JsonReader, IEnumerable<String>, Action<JsonReader,String>)

Source:
JsonExtensions.cs

Reads the properties of JSON objects, enforcing the presence of required properties and ignoring the order of properties.

public static void ReadObject (this Newtonsoft.Json.JsonReader reader, System.Collections.Generic.IEnumerable<string> requiredProperties, Action<Newtonsoft.Json.JsonReader,string> readProperty);
static member ReadObject : Newtonsoft.Json.JsonReader * seq<string> * Action<Newtonsoft.Json.JsonReader, string> -> unit
<Extension()>
Public Sub ReadObject (reader As JsonReader, requiredProperties As IEnumerable(Of String), readProperty As Action(Of JsonReader, String))

Parameters

reader
Newtonsoft.Json.JsonReader

The JSON reader to use to read an object.

requiredProperties
IEnumerable<String>

The names of all JSON properties that are expected to be present in the parsed object.

readProperty
Action<Newtonsoft.Json.JsonReader,String>

A callback that reads a property value with the given name from the given JsonReader. It must advance the reader to the name of the next property, or the end of the object if there are no more properties to read.

Remarks

This method will leave the reader positioned on the end of the object.

Applies to

ReadObject(JsonReader, IEnumerable<String>, IEnumerable<String>, Action<JsonReader,String>)

Source:
JsonExtensions.cs

Reads the properties of JSON objects, enforcing the presence of required properties and ignoring the order of properties.

public static void ReadObject (this Newtonsoft.Json.JsonReader reader, System.Collections.Generic.IEnumerable<string> requiredProperties, System.Collections.Generic.IEnumerable<string> optionalProperties, Action<Newtonsoft.Json.JsonReader,string> readProperty);
static member ReadObject : Newtonsoft.Json.JsonReader * seq<string> * seq<string> * Action<Newtonsoft.Json.JsonReader, string> -> unit
<Extension()>
Public Sub ReadObject (reader As JsonReader, requiredProperties As IEnumerable(Of String), optionalProperties As IEnumerable(Of String), readProperty As Action(Of JsonReader, String))

Parameters

reader
Newtonsoft.Json.JsonReader

The JSON reader to use to read an object.

requiredProperties
IEnumerable<String>

The names of all JSON properties that are expected to be present in the parsed object.

optionalProperties
IEnumerable<String>

The names of JSON properties besides the required properties that may be present in the parsed object.

readProperty
Action<Newtonsoft.Json.JsonReader,String>

A callback that reads a property value with the given name from the given JsonReader. It must advance the reader to the name of the next property, or the end of the object if there are no more properties to read.

Remarks

This method will leave the reader positioned on the end of the object.

Applies to