DefaultJsonTypeInfoResolver.GetTypeInfo(Type, JsonSerializerOptions) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
解析給定typeoptions設定的 JSON 合約。
public:
virtual System::Text::Json::Serialization::Metadata::JsonTypeInfo ^ GetTypeInfo(Type ^ type, System::Text::Json::JsonSerializerOptions ^ options);
public virtual System.Text.Json.Serialization.Metadata.JsonTypeInfo GetTypeInfo(Type type, System.Text.Json.JsonSerializerOptions options);
abstract member GetTypeInfo : Type * System.Text.Json.JsonSerializerOptions -> System.Text.Json.Serialization.Metadata.JsonTypeInfo
override this.GetTypeInfo : Type * System.Text.Json.JsonSerializerOptions -> System.Text.Json.Serialization.Metadata.JsonTypeInfo
Public Overridable Function GetTypeInfo (type As Type, options As JsonSerializerOptions) As JsonTypeInfo
參數
- type
- Type
用來解析 JSON 合約的類型。
- options
- JsonSerializerOptions
一個 JsonSerializerOptions 用來決定合約配置的實例。
傳回
JsonTypeInfo A 定義一個反射導出的 JSON 合約。type
實作
例外狀況
type 或 options 為 null。
備註
此方法的基礎實作會產生一個反射導出的合約,並套用列表中 Modifiers 的任何回調。