JsonDocument JsonDocument JsonDocument JsonDocument Class

Definition

Provides a mechanism for examining the structural content of a JSON value without automatically instantiating data values.

public ref class JsonDocument sealed : IDisposable
public sealed class JsonDocument : IDisposable
type JsonDocument = class
    interface IDisposable
Public NotInheritable Class JsonDocument
Implements IDisposable
Inheritance
JsonDocumentJsonDocumentJsonDocumentJsonDocument
Implements

Remarks

This class utilizes resources from pooled memory to minimize the impact of the garbage collector (GC) in high-usage scenarios. Failure to properly dispose this object will result in the memory not being returned to the pool, which will increase GC impact across various parts of the framework.

Properties

RootElement RootElement RootElement RootElement

Gets the root element of this JSON document.

Methods

Dispose() Dispose() Dispose() Dispose()

Releases the resources used by this JsonDocument instance.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
Parse(ReadOnlyMemory<Byte>, JsonDocumentOptions) Parse(ReadOnlyMemory<Byte>, JsonDocumentOptions) Parse(ReadOnlyMemory<Byte>, JsonDocumentOptions) Parse(ReadOnlyMemory<Byte>, JsonDocumentOptions)

Parses memory as UTF-8-encoded text representing a single JSON byte value into a JsonDocument.

Parse(ReadOnlyMemory<Char>, JsonDocumentOptions) Parse(ReadOnlyMemory<Char>, JsonDocumentOptions) Parse(ReadOnlyMemory<Char>, JsonDocumentOptions) Parse(ReadOnlyMemory<Char>, JsonDocumentOptions)

Parses text representing a single JSON character value into a JsonDocument.

Parse(ReadOnlySequence<Byte>, JsonDocumentOptions) Parse(ReadOnlySequence<Byte>, JsonDocumentOptions) Parse(ReadOnlySequence<Byte>, JsonDocumentOptions) Parse(ReadOnlySequence<Byte>, JsonDocumentOptions)

Parses a sequence as UTF-8-encoded text representing a single JSON byte value into a JsonDocument.

Parse(Stream, JsonDocumentOptions) Parse(Stream, JsonDocumentOptions) Parse(Stream, JsonDocumentOptions) Parse(Stream, JsonDocumentOptions)

Parses a Stream as UTF-8-encoded data representing a single JSON value into a JsonDocument. The stream is read to completion.

Parse(String, JsonDocumentOptions) Parse(String, JsonDocumentOptions) Parse(String, JsonDocumentOptions) Parse(String, JsonDocumentOptions)

Parses text representing a single JSON string value into a JsonDocument.

ParseAsync(Stream, JsonDocumentOptions, CancellationToken) ParseAsync(Stream, JsonDocumentOptions, CancellationToken) ParseAsync(Stream, JsonDocumentOptions, CancellationToken) ParseAsync(Stream, JsonDocumentOptions, CancellationToken)

Parses a Stream as UTF-8-encoded data representing a single JSON value into a JsonDocument. The stream is read to completion.

ParseValue(Utf8JsonReader) ParseValue(Utf8JsonReader) ParseValue(Utf8JsonReader) ParseValue(Utf8JsonReader)

Parses one JSON value (including objects or arrays) from the provided reader.

ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)
TryParseValue(Utf8JsonReader, JsonDocument) TryParseValue(Utf8JsonReader, JsonDocument) TryParseValue(Utf8JsonReader, JsonDocument) TryParseValue(Utf8JsonReader, JsonDocument)

Attempts to parse one JSON value (including objects or arrays) from the provided reader.

WriteTo(Utf8JsonWriter) WriteTo(Utf8JsonWriter) WriteTo(Utf8JsonWriter) WriteTo(Utf8JsonWriter)

Writes the document to the provided writer as a JSON value.

Applies to