<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />

JsonReader

public abstract class JsonReader : IDisposable
Represents a reader that provides fast, non-cached, forward-only access to serialized JSON data.
public bool CloseInput { get; set; }

Gets or sets a value indicating whether the source should be closed when this reader is closed.

public CultureInfo Culture { get; set; }

Gets or sets the culture used when reading JSON. Defaults to InvariantCulture.

protected State CurrentState { get; }

Gets the current reader state.

public string DateFormatString { get; set; }

Gets or sets how custom date formatted strings are parsed when reading JSON.

public DateParseHandling DateParseHandling { get; set; }

Gets or sets how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON.

Gets or sets how DateTime time zones are handled when reading JSON.

public virtual int Depth { get; }

Gets the depth of the current token in the JSON document.

Gets or sets how floating point numbers, e.g. 1.0 and 9.9, are parsed when reading JSON text.

public int? MaxDepth { get; set; }

Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a JsonReaderException.

public virtual string Path { get; }

Gets the path of the current JSON token.

public virtual char QuoteChar { get; protected set; }

Gets the quotation mark character used to enclose the value of a string.

public bool SupportMultipleContent { get; set; }

Gets or sets a value indicating whether multiple pieces of JSON content can be read from a continuous stream without erroring.

public virtual JsonToken TokenType { get; }

Gets the type of the current JSON token.

public virtual object Value { get; }

Gets the text value of the current JSON token.

public virtual Type ValueType { get; }

Gets the .NET type for the current JSON token.

protected JsonReader()

Initializes a new instance of the JsonReader class.

public virtual void Close()

Changes the reader's state to Closed. If CloseInput is set to true, the source is also closed.

protected virtual void Dispose(bool disposing)

Releases unmanaged and - optionally - managed resources.

public abstract bool Read()

Reads the next JSON token from the source.

public virtual bool? ReadAsBoolean()

Reads the next JSON token from the source as a Nullable<T> of Boolean.

public virtual Task<bool?> ReadAsBooleanAsync(CancellationToken cancellationToken = default)

Asynchronously reads the next JSON token from the source as a Nullable<T> of Boolean.

public virtual byte[] ReadAsBytes()

Reads the next JSON token from the source as a Byte[].

public virtual Task<byte[]> ReadAsBytesAsync(CancellationToken cancellationToken = default)

Asynchronously reads the next JSON token from the source as a Byte[].

public virtual DateTime? ReadAsDateTime()

Reads the next JSON token from the source as a Nullable<T> of DateTime.

public virtual Task<DateTime?> ReadAsDateTimeAsync(CancellationToken cancellationToken = default)

Asynchronously reads the next JSON token from the source as a Nullable<T> of DateTime.

Reads the next JSON token from the source as a Nullable<T> of DateTimeOffset.

public virtual Task<DateTimeOffset?> ReadAsDateTimeOffsetAsync(CancellationToken cancellationToken = default)

Asynchronously reads the next JSON token from the source as a Nullable<T> of DateTimeOffset.

public virtual decimal? ReadAsDecimal()

Reads the next JSON token from the source as a Nullable<T> of Decimal.

public virtual Task<decimal?> ReadAsDecimalAsync(CancellationToken cancellationToken = default)

Asynchronously reads the next JSON token from the source as a Nullable<T> of Decimal.

public virtual double? ReadAsDouble()

Reads the next JSON token from the source as a Nullable<T> of Double.

public virtual Task<double?> ReadAsDoubleAsync(CancellationToken cancellationToken = default)

Asynchronously reads the next JSON token from the source as a Nullable<T> of Double.

public virtual int? ReadAsInt32()

Reads the next JSON token from the source as a Nullable<T> of Int32.

public virtual Task<int?> ReadAsInt32Async(CancellationToken cancellationToken = default)

Asynchronously reads the next JSON token from the source as a Nullable<T> of Int32.

public virtual string ReadAsString()

Reads the next JSON token from the source as a String.

public virtual Task<string> ReadAsStringAsync(CancellationToken cancellationToken = default)

Asynchronously reads the next JSON token from the source as a String.

public virtual Task<bool> ReadAsync(CancellationToken cancellationToken = default)

Asynchronously reads the next JSON token from the source.

protected void SetStateBasedOnCurrent()

Sets the state based on current token type.

protected void SetToken(JsonToken newToken)

Sets the current token.

protected void SetToken(JsonToken newToken, object value)

Sets the current token and value.

protected void SetToken(JsonToken newToken, object value, bool updateIndex)

Sets the current token and value.

public void Skip()

Skips the children of the current token.

public Task SkipAsync(CancellationToken cancellationToken = default)

Asynchronously skips the children of the current token.