JsonSerializer.SerializeToElement Metoda

Definicja

Przeciążenia

SerializeToElement(Object, JsonTypeInfo)

Konwertuje podaną wartość na wartość JsonElement.

SerializeToElement(Object, Type, JsonSerializerOptions)

Konwertuje podaną wartość na wartość JsonDocument.

SerializeToElement(Object, Type, JsonSerializerContext)

Konwertuje podaną wartość na wartość JsonDocument.

SerializeToElement<TValue>(TValue, JsonTypeInfo<TValue>)

Konwertuje podaną wartość na wartość JsonDocument.

SerializeToElement<TValue>(TValue, JsonSerializerOptions)

Konwertuje podaną wartość na wartość JsonDocument.

SerializeToElement(Object, JsonTypeInfo)

Źródło:
JsonSerializer.Write.Element.cs
Źródło:
JsonSerializer.Write.Element.cs

Konwertuje podaną wartość na wartość JsonElement.

public:
 static System::Text::Json::JsonElement SerializeToElement(System::Object ^ value, System::Text::Json::Serialization::Metadata::JsonTypeInfo ^ jsonTypeInfo);
public static System.Text.Json.JsonElement SerializeToElement (object? value, System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo);
static member SerializeToElement : obj * System.Text.Json.Serialization.Metadata.JsonTypeInfo -> System.Text.Json.JsonElement
Public Function SerializeToElement (value As Object, jsonTypeInfo As JsonTypeInfo) As JsonElement

Parametry

value
Object

Wartość do konwersji.

jsonTypeInfo
JsonTypeInfo

Metadane dotyczące typu do konwersji.

Zwraca

Reprezentacja JsonElement wartości.

Wyjątki

jsonTypeInfo to null.

value nie jest zgodny z typem jsonTypeInfo.

Dotyczy

SerializeToElement(Object, Type, JsonSerializerOptions)

Źródło:
JsonSerializer.Write.Element.cs
Źródło:
JsonSerializer.Write.Element.cs
Źródło:
JsonSerializer.Write.Element.cs

Konwertuje podaną wartość na wartość JsonDocument.

public static System.Text.Json.JsonElement SerializeToElement (object? value, Type inputType, System.Text.Json.JsonSerializerOptions? options = default);
static member SerializeToElement : obj * Type * System.Text.Json.JsonSerializerOptions -> System.Text.Json.JsonElement
Public Function SerializeToElement (value As Object, inputType As Type, Optional options As JsonSerializerOptions = Nothing) As JsonElement

Parametry

value
Object

Wartość do konwersji.

inputType
Type

Typ elementu do konwersji value .

options
JsonSerializerOptions

Opcje kontrolowania zachowania konwersji.

Zwraca

Reprezentacja JsonDocument wartości.

Wyjątki

inputType nie jest zgodny z programem value.

inputType to null.

Nie ma żadnych zgodnych JsonConverter elementów inputType członkowskich ani ich serializacji.

Dotyczy

SerializeToElement(Object, Type, JsonSerializerContext)

Źródło:
JsonSerializer.Write.Element.cs
Źródło:
JsonSerializer.Write.Element.cs
Źródło:
JsonSerializer.Write.Element.cs

Konwertuje podaną wartość na wartość JsonDocument.

public:
 static System::Text::Json::JsonElement SerializeToElement(System::Object ^ value, Type ^ inputType, System::Text::Json::Serialization::JsonSerializerContext ^ context);
public static System.Text.Json.JsonElement SerializeToElement (object? value, Type inputType, System.Text.Json.Serialization.JsonSerializerContext context);
static member SerializeToElement : obj * Type * System.Text.Json.Serialization.JsonSerializerContext -> System.Text.Json.JsonElement
Public Function SerializeToElement (value As Object, inputType As Type, context As JsonSerializerContext) As JsonElement

Parametry

value
Object

Wartość do konwersji.

inputType
Type

Typ elementu do konwersji value .

context
JsonSerializerContext

Dostawca metadanych dla typów z możliwością serializacji.

Zwraca

Reprezentacja JsonDocument wartości.

Wyjątki

Nie ma żadnych zgodnych JsonConverter elementów inputType członkowskich ani ich serializacji.

Metoda GetTypeInfo(Type) podanego context zwraca null wartość dla typu do przekonwertowania.

inputType lub context to null.

Dotyczy

SerializeToElement<TValue>(TValue, JsonTypeInfo<TValue>)

Źródło:
JsonSerializer.Write.Element.cs
Źródło:
JsonSerializer.Write.Element.cs
Źródło:
JsonSerializer.Write.Element.cs

Konwertuje podaną wartość na wartość JsonDocument.

public:
generic <typename TValue>
 static System::Text::Json::JsonElement SerializeToElement(TValue value, System::Text::Json::Serialization::Metadata::JsonTypeInfo<TValue> ^ jsonTypeInfo);
public static System.Text.Json.JsonElement SerializeToElement<TValue> (TValue value, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TValue> jsonTypeInfo);
static member SerializeToElement : 'Value * System.Text.Json.Serialization.Metadata.JsonTypeInfo<'Value> -> System.Text.Json.JsonElement
Public Function SerializeToElement(Of TValue) (value As TValue, jsonTypeInfo As JsonTypeInfo(Of TValue)) As JsonElement

Parametry typu

TValue

Typ wartości do serializacji.

Parametry

value
TValue

Wartość do konwersji.

jsonTypeInfo
JsonTypeInfo<TValue>

Metadane dotyczące typu do konwersji.

Zwraca

Reprezentacja JsonDocument wartości.

Wyjątki

Nie ma żadnych zgodnych JsonConverter elementów TValue członkowskich ani ich serializacji.

jsonTypeInfo to null.

Dotyczy

SerializeToElement<TValue>(TValue, JsonSerializerOptions)

Źródło:
JsonSerializer.Write.Element.cs
Źródło:
JsonSerializer.Write.Element.cs
Źródło:
JsonSerializer.Write.Element.cs

Konwertuje podaną wartość na wartość JsonDocument.

public static System.Text.Json.JsonElement SerializeToElement<TValue> (TValue value, System.Text.Json.JsonSerializerOptions? options = default);
static member SerializeToElement : 'Value * System.Text.Json.JsonSerializerOptions -> System.Text.Json.JsonElement
Public Function SerializeToElement(Of TValue) (value As TValue, Optional options As JsonSerializerOptions = Nothing) As JsonElement

Parametry typu

TValue

Typ wartości do serializacji.

Parametry

value
TValue

Wartość do konwersji.

options
JsonSerializerOptions

Opcje kontrolowania zachowania konwersji.

Zwraca

Reprezentacja JsonDocument wartości JSON.

Wyjątki

Nie ma żadnych zgodnych JsonConverter elementów TValue członkowskich ani ich serializacji.

Dotyczy