JsonMetadataServices.CreateObjectInfo<T> 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
為複雜類別或結構建立元資料。
public:
generic <typename T>
static System::Text::Json::Serialization::Metadata::JsonTypeInfo<T> ^ CreateObjectInfo(System::Text::Json::JsonSerializerOptions ^ options, System::Text::Json::Serialization::Metadata::JsonObjectInfoValues<T> ^ objectInfo);
public static System.Text.Json.Serialization.Metadata.JsonTypeInfo<T> CreateObjectInfo<T>(System.Text.Json.JsonSerializerOptions options, System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<T> objectInfo);
static member CreateObjectInfo : System.Text.Json.JsonSerializerOptions * System.Text.Json.Serialization.Metadata.JsonObjectInfoValues<'T> -> System.Text.Json.Serialization.Metadata.JsonTypeInfo<'T>
Public Shared Function CreateObjectInfo(Of T) (options As JsonSerializerOptions, objectInfo As JsonObjectInfoValues(Of T)) As JsonTypeInfo(Of T)
類型參數
- T
類別或結構的類型。
參數
- options
- JsonSerializerOptions
用於 JsonSerializerOptions 序列化與反序列化。
- objectInfo
- JsonObjectInfoValues<T>
提供關於物件類型的序列化元資料,包含建構子、屬性與欄位。
傳回
一個 JsonTypeInfo<T> 代表類別或結構體的實例。
例外狀況
options 或 objectInfo 為 null。
備註
此 API 供 System.Text.Json 原始碼產生器的輸出使用,不應直接呼叫。