Share via


JsonExtensions.ReadObjectAndAdvance Method

Definition

Reads the properties of JSON objects, enforcing the presence of required properties and ignoring the order of properties, and then advances the given reader to the next token after the end of the object.

public static void ReadObjectAndAdvance (this Newtonsoft.Json.JsonReader reader, System.Collections.Generic.IEnumerable<string> requiredProperties, Action<Newtonsoft.Json.JsonReader,string> readProperty);
static member ReadObjectAndAdvance : Newtonsoft.Json.JsonReader * seq<string> * Action<Newtonsoft.Json.JsonReader, string> -> unit
<Extension()>
Public Sub ReadObjectAndAdvance (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 advance the reader to the next position after the end of the object.

Applies to