JsonSerializer.SerializeToElement Metoda

Definicja

Przeciążenia

SerializeToElement(Object, JsonTypeInfo)

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

SerializeToElement(Object, Type, JsonSerializerOptions)

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

SerializeToElement(Object, Type, JsonSerializerContext)

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

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

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

SerializeToElement<TValue>(TValue, JsonSerializerOptions)

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

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ść JsonElement.

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 obiektu do konwersji value .

options
JsonSerializerOptions

Opcje kontrolowania zachowania konwersji.

Zwraca

Reprezentacja JsonElement wartości.

Wyjątki

inputType program nie jest zgodny z programem value.

inputType to null.

Nie ma zgodności JsonConverter z elementami członkowskimi, które inputType można serializować.

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ść JsonElement.

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 obiektu do konwersji value .

context
JsonSerializerContext

Dostawca metadanych dla typów możliwych do serializacji.

Zwraca

Reprezentacja JsonElement wartości.

Wyjątki

Nie ma zgodności JsonConverter z elementami członkowskimi, które inputType można serializować.

Metoda GetTypeInfo(Type) podanego context zwraca null typ, który ma być konwertowany.

inputType lub context ma wartość 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ść JsonElement.

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 JsonElement wartości.

Wyjątki

Nie ma zgodności JsonConverter z elementami członkowskimi, które TValue można serializować.

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ść JsonElement.

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 JsonElement wartości JSON.

Wyjątki

Nie ma zgodności JsonConverter z elementami członkowskimi, które TValue można serializować.

Dotyczy