共用方式為


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>實例,表示類別或結構。

例外狀況

optionsobjectInfonull

備註

此 API 可供 System.Text.Json 來源產生器的輸出使用,不應直接呼叫。

適用於