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 來源產生器的輸出使用,不應直接呼叫。