DefaultJsonTypeInfoResolver.GetTypeInfo(Type, JsonSerializerOptions) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
解析给定 type
和 options
配置的 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定义反射派生的 JSON 协定。type
实现
例外
type
或 options
为 null
。
注解
此方法的基本实现将生成反射派生的协定,并从列表中应用任何回调 Modifiers 。