Język

JsonTypeInfo.CreateJsonTypeInfo Metoda

Definicja

Przeciążenia

CreateJsonTypeInfo(Type, JsonSerializerOptions)

Źródło:
JsonTypeInfo.cs
Źródło:
JsonTypeInfo.cs
Źródło:
JsonTypeInfo.cs
Źródło:
JsonTypeInfo.cs
Źródło:
JsonTypeInfo.cs
Źródło:
JsonTypeInfo.cs
Źródło:
JsonTypeInfo.cs
Źródło:
JsonTypeInfo.cs

Tworzy puste JsonTypeInfo wystąpienie.

public:
 static System::Text::Json::Serialization::Metadata::JsonTypeInfo ^ CreateJsonTypeInfo(Type ^ type, System::Text::Json::JsonSerializerOptions ^ options);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
public static System.Text.Json.Serialization.Metadata.JsonTypeInfo CreateJsonTypeInfo(Type type, System.Text.Json.JsonSerializerOptions options);
public static System.Text.Json.Serialization.Metadata.JsonTypeInfo CreateJsonTypeInfo(Type type, System.Text.Json.JsonSerializerOptions options);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")>]
static member CreateJsonTypeInfo : Type * System.Text.Json.JsonSerializerOptions -> System.Text.Json.Serialization.Metadata.JsonTypeInfo
static member CreateJsonTypeInfo : Type * System.Text.Json.JsonSerializerOptions -> System.Text.Json.Serialization.Metadata.JsonTypeInfo
Public Shared Function CreateJsonTypeInfo (type As Type, options As JsonSerializerOptions) As JsonTypeInfo

Parametry

type
Type

Typ, dla którego określono metadane kontraktu.

options
JsonSerializerOptions

Wystąpienie JsonSerializerOptions , z które są skojarzone metadane.

Zwraca

Puste JsonTypeInfo wystąpienie.

Atrybuty

Wyjątki

type lub options ma wartość null.

type nie można użyć do serializacji.

Uwagi

Zwrócona JsonTypeInfo wartość będzie pusta, z wyjątkiem Converter właściwości, która zostanie rozpoznana z Converters lub wbudowanych konwerterów dla typu. Wszystkie konwertery określone za pomocą JsonConverterAttribute deklaracji typu nie zostaną rozpoznane przez tę metodę.

Który konwerter jest rozpoznawany wpływa na wartość Kind, która ogranicza typ metadanych, które można zmodyfikować w wystąpieniu JsonTypeInfo .

Dotyczy

CreateJsonTypeInfo<T>(JsonSerializerOptions)

Źródło:
JsonTypeInfo.cs
Źródło:
JsonTypeInfo.cs
Źródło:
JsonTypeInfo.cs
Źródło:
JsonTypeInfo.cs
Źródło:
JsonTypeInfo.cs
Źródło:
JsonTypeInfo.cs
Źródło:
JsonTypeInfo.cs
Źródło:
JsonTypeInfo.cs

Tworzy puste JsonTypeInfo<T> wystąpienie.

public:
generic <typename T>
 static System::Text::Json::Serialization::Metadata::JsonTypeInfo<T> ^ CreateJsonTypeInfo(System::Text::Json::JsonSerializerOptions ^ options);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
public static System.Text.Json.Serialization.Metadata.JsonTypeInfo<T> CreateJsonTypeInfo<T>(System.Text.Json.JsonSerializerOptions options);
public static System.Text.Json.Serialization.Metadata.JsonTypeInfo<T> CreateJsonTypeInfo<T>(System.Text.Json.JsonSerializerOptions options);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")>]
static member CreateJsonTypeInfo : System.Text.Json.JsonSerializerOptions -> System.Text.Json.Serialization.Metadata.JsonTypeInfo<'T>
static member CreateJsonTypeInfo : System.Text.Json.JsonSerializerOptions -> System.Text.Json.Serialization.Metadata.JsonTypeInfo<'T>
Public Shared Function CreateJsonTypeInfo(Of T) (options As JsonSerializerOptions) As JsonTypeInfo(Of T)

Parametry typu

T

Typ, dla którego określono metadane kontraktu.

Parametry

options
JsonSerializerOptions

Wystąpienie JsonSerializerOptions , z które są skojarzone metadane.

Zwraca

Puste JsonTypeInfo<T> wystąpienie.

Atrybuty

Wyjątki

Parametr options ma wartość null.

Uwagi

Zwrócony <element see cref="T:System.Text.Json.Serialization.Metadata.JsonTypeInfo'1> będzie pusty, z wyjątkiem Converter właściwości, która zostanie rozpoznana z Converters lub wbudowanych konwerterów dla tego typu. Wszystkie konwertery określone za pomocą JsonConverterAttribute deklaracji typu nie zostaną rozpoznane przez tę metodę.

Który konwerter jest rozpoznawany wpływa na wartość Kind, która ogranicza typ metadanych, które można zmodyfikować w wystąpieniu JsonTypeInfo .

Dotyczy