語言

JsonMetadataServices.CreateObjectInfo<T> 方法

定義

為複雜類別或結構建立元資料。

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

適用於