語言

JsonSerializerOptions.GetTypeInfo 方法

定義

多載

名稱 Description
GetTypeInfo(Type)

讓 JsonTypeInfo 合約的元資料由目前 JsonSerializerOptions 實例解析。

GetTypeInfo<T>()

GetTypeInfo(Type)

來源:
JsonSerializerOptions.Caching.cs
來源:
JsonSerializerOptions.Caching.cs
來源:
JsonSerializerOptions.Caching.cs
來源:
JsonSerializerOptions.Caching.cs
來源:
JsonSerializerOptions.Caching.cs
來源:
JsonSerializerOptions.Caching.cs
來源:
JsonSerializerOptions.Caching.cs
來源:
JsonSerializerOptions.Caching.cs

讓 JsonTypeInfo 合約的元資料由目前 JsonSerializerOptions 實例解析。

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

參數

type
Type

要解決合約元資料的類型。

傳回

合約元資料解析為 type。

例外狀況

type 是 null。

type 不適用於序列化。

備註

回傳的元資料可以下傳到 JsonTypeInfo<T> 相關 JsonSerializer 超載區並使用。

若 JsonSerializerOptions 實例被鎖定以供修改,方法會回傳一個快取的實例作為元資料。

適用於

GetTypeInfo<T>()

來源:
JsonSerializerOptions.Caching.cs
來源:
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)

類型參數

T

傳回

適用於