JsonSerializer Clase
Definición
Proporciona funcionalidad para serializar objetos o tipos de valor en JSON y para deserializar JSON en objetos o tipos de valor.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
- Herencia
-
JsonSerializer
Comentarios
Para obtener más información, vea Cómo serializar y deserializar JSON.For more information, see How to serialize and deserialize JSON.
Métodos
| Deserialize(ReadOnlySpan<Byte>, Type, JsonSerializerOptions) |
Analiza el texto con codificación UTF-8 que representa un único valor JSON en una instancia de un tipo especificado.Parses the UTF-8 encoded text representing a single JSON value into an instance of a specified type. |
| Deserialize(String, Type, JsonSerializerOptions) |
Analiza el texto que representa un único valor JSON en una instancia de un tipo especificado.Parses the text representing a single JSON value into an instance of a specified type. |
| Deserialize(Utf8JsonReader, Type, JsonSerializerOptions) |
Lee un valor JSON (incluidos objetos o matrices) desde el lector proporcionado y lo convierte en una instancia del tipo especificado.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) |
Analiza el texto con codificación UTF-8 que representa un único valor JSON en una instancia del tipo especificado por un parámetro de tipo genérico.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) |
Analiza el texto que representa un único valor JSON en una instancia del tipo especificado por un parámetro de tipo genérico.Parses the text representing a single JSON value into an instance of the type specified by a generic type parameter. |
| Deserialize<TValue>(Utf8JsonReader, JsonSerializerOptions) |
Lee un valor JSON (incluidos objetos o matrices) desde el lector proporcionado en una instancia del tipo especificado por un parámetro de tipo genérico.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) |
Lee asincrónicamente el texto con codificación UTF-8 que representa un único valor JSON en una instancia de un tipo especificado.Asynchronously reads the UTF-8 encoded text representing a single JSON value into an instance of a specified type. La secuencia se lee hasta su finalización.The stream will be read to completion. |
| DeserializeAsync<TValue>(Stream, JsonSerializerOptions, CancellationToken) |
Lee asincrónicamente el texto con codificación UTF-8 que representa un único valor JSON en una instancia de un tipo especificado por un parámetro de tipo genérico.Asynchronously reads the UTF-8 encoded text representing a single JSON value into an instance of a type specified by a generic type parameter. La secuencia se lee hasta su finalización.The stream will be read to completion. |
| Serialize(Object, Type, JsonSerializerOptions) |
Convierte el valor de un tipo especificado en una cadena JSON.Converts the value of a specified type into a JSON string. |
| Serialize(Utf8JsonWriter, Object, Type, JsonSerializerOptions) |
Escribe la representación JSON del tipo especificado en el sistema de escritura proporcionado.Writes the JSON representation of the specified type to the provided writer. |
| Serialize<TValue>(TValue, JsonSerializerOptions) |
Convierte el valor de un tipo especificado por un parámetro de tipo genérico en una cadena JSON.Converts the value of a type specified by a generic type parameter into a JSON string. |
| Serialize<TValue>(Utf8JsonWriter, TValue, JsonSerializerOptions) |
Escribe la representación JSON de un tipo especificado por un parámetro de tipo genérico en el sistema de escritura proporcionado.Writes the JSON representation of a type specified by a generic type parameter to the provided writer. |
| SerializeAsync(Stream, Object, Type, JsonSerializerOptions, CancellationToken) |
Convierte de forma asincrónica el valor de un tipo especificado en texto JSON con codificación UTF-8 y lo escribe en la secuencia especificada.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) |
Convierte de forma asincrónica un valor de un tipo especificado por un parámetro de tipo genérico a texto JSON con codificación UTF-8 y lo escribe en una secuencia.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) |
Convierte un valor del tipo especificado en una cadena JSON, codificada como bytes UTF-8.Converts a value of the specified type into a JSON string, encoded as UTF-8 bytes. |
| SerializeToUtf8Bytes<TValue>(TValue, JsonSerializerOptions) |
Convierte el valor de un tipo especificado por un parámetro de tipo genérico en una cadena JSON, codificada como bytes UTF-8.Converts the value of a type specified by a generic type parameter into a JSON string, encoded as UTF-8 bytes. |