JsonSerializer Class

Definition

Provides functionality to serialize objects or value types to JSON and to deserialize JSON into objects or value types.

public ref class JsonSerializer abstract sealed
public static class JsonSerializer
type JsonSerializer = class
Public Class JsonSerializer
Inheritance
JsonSerializer

Methods

Deserialize(ReadOnlySpan<Byte>, Type, JsonSerializerOptions)

Parses the UTF-8 encoded text representing a single JSON value into an instance of a specified type.

Deserialize(String, Type, JsonSerializerOptions)

Parses the text representing a single JSON value into an instance of a specified type.

Deserialize(Utf8JsonReader, Type, JsonSerializerOptions)

Reads one JSON value (including objects or arrays) from the provided reader and converts it into an instance of a specified type.

Deserialize<TValue>(ReadOnlySpan<Byte>, JsonSerializerOptions)

Parses the UTF-8 encoded text representing a single JSON value into an instance of the type specified by a generic type parameter.

Deserialize<TValue>(String, JsonSerializerOptions)

Parses the text representing a single JSON value into an instance of the type specified by a generic type parameter.

Deserialize<TValue>(Utf8JsonReader, JsonSerializerOptions)

Reads one JSON value (including objects or arrays) from the provided reader into an instance of the type specified by a generic type parameter.

DeserializeAsync(Stream, Type, JsonSerializerOptions, CancellationToken)

Asynchronously reads the UTF-8 encoded text representing a single JSON value into an instance of a specified type. The stream will be read to completion.

DeserializeAsync<TValue>(Stream, JsonSerializerOptions, CancellationToken)

Asynchronously reads the UTF-8 encoded text representing a single JSON value into an instance of a type specified by a generic type parameter. The stream will be read to completion.

Serialize(Object, Type, JsonSerializerOptions)

Converts the value of a specified type into a JSON string.

Serialize(Utf8JsonWriter, Object, Type, JsonSerializerOptions)

Writes the JSON representation of the specified type to the provided writer.

Serialize<TValue>(TValue, JsonSerializerOptions)

Converts the value of a type specified by a generic type parameter into a JSON string.

Serialize<TValue>(Utf8JsonWriter, TValue, JsonSerializerOptions)

Writes the JSON representation of a type specified by a generic type parameter to the provided writer.

SerializeAsync(Stream, Object, Type, JsonSerializerOptions, CancellationToken)

Asynchronously converts the value of a specified type to UTF-8 encoded JSON text and writes it to the specified stream.

SerializeAsync<TValue>(Stream, TValue, JsonSerializerOptions, CancellationToken)

Asynchronously converts a value of a type specified by a generic type parameter to UTF-8 encoded JSON text and writes it to a stream.

SerializeToUtf8Bytes(Object, Type, JsonSerializerOptions)

Converts a value of the specified type into a JSON string, encoded as UTF-8 bytes.

SerializeToUtf8Bytes<TValue>(TValue, JsonSerializerOptions)

Converts the value of a type specified by a generic type parameter into a JSON string, encoded as UTF-8 bytes.

Applies to