Rediger

Del via


JsonSerializerOptions.GetTypeInfo Method

Definition

Overloads

Name Description
GetTypeInfo(Type)

Gets the JsonTypeInfo contract metadata resolved by the current JsonSerializerOptions instance.

GetTypeInfo<T>()

GetTypeInfo(Type)

Source:
JsonSerializerOptions.Caching.cs
Source:
JsonSerializerOptions.Caching.cs
Source:
JsonSerializerOptions.Caching.cs
Source:
JsonSerializerOptions.Caching.cs
Source:
JsonSerializerOptions.Caching.cs
Source:
JsonSerializerOptions.Caching.cs
Source:
JsonSerializerOptions.Caching.cs

Gets the JsonTypeInfo contract metadata resolved by the current JsonSerializerOptions instance.

public:
 System::Text::Json::Serialization::Metadata::JsonTypeInfo ^ GetTypeInfo(Type ^ type);
public System.Text.Json.Serialization.Metadata.JsonTypeInfo GetTypeInfo(Type type);
member this.GetTypeInfo : Type -> System.Text.Json.Serialization.Metadata.JsonTypeInfo
Public Function GetTypeInfo (type As Type) As JsonTypeInfo

Parameters

type
Type

The type to resolve contract metadata for.

Returns

The contract metadata resolved for type.

Exceptions

type is null.

type is not valid for serialization.

Remarks

Returned metadata can be downcast to JsonTypeInfo<T> and used with the relevant JsonSerializer overloads.

If the JsonSerializerOptions instance is locked for modification, the method returns a cached instance for the metadata.

Applies to

GetTypeInfo<T>()

Source:
JsonSerializerOptions.Caching.cs
public:
generic <typename T>
 System::Text::Json::Serialization::Metadata::JsonTypeInfo<T> ^ GetTypeInfo();
public System.Text.Json.Serialization.Metadata.JsonTypeInfo<T> GetTypeInfo<T>();
member this.GetTypeInfo : unit -> System.Text.Json.Serialization.Metadata.JsonTypeInfo<'T>
Public Function GetTypeInfo(Of T) () As JsonTypeInfo(Of T)

Type Parameters

T

Returns

Applies to