語言

JsonMetadataServices.CreatePropertyInfo<T> 方法

定義

為屬性或欄位建立元資料。

public:
generic <typename T>
 static System::Text::Json::Serialization::Metadata::JsonPropertyInfo ^ CreatePropertyInfo(System::Text::Json::JsonSerializerOptions ^ options, System::Text::Json::Serialization::Metadata::JsonPropertyInfoValues<T> ^ propertyInfo);
public static System.Text.Json.Serialization.Metadata.JsonPropertyInfo CreatePropertyInfo<T>(System.Text.Json.JsonSerializerOptions options, System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<T> propertyInfo);
static member CreatePropertyInfo : System.Text.Json.JsonSerializerOptions * System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues<'T> -> System.Text.Json.Serialization.Metadata.JsonPropertyInfo
Public Shared Function CreatePropertyInfo(Of T) (options As JsonSerializerOptions, propertyInfo As JsonPropertyInfoValues(Of T)) As JsonPropertyInfo

類型參數

T

就是該屬性的轉換器在轉換 JSON 資料時回傳或接受的類型。

參數

options
JsonSerializerOptions

用於 JsonSerializerOptions 序列化與反序列化。

propertyInfo
JsonPropertyInfoValues<T>

提供關於屬性或欄位的序列化元資料。

傳回

一個 JsonPropertyInfo 以所提供的元資料初始化的實例。

備註

此 API 供 System.Text.Json 原始碼產生器的輸出使用,不應直接呼叫。

適用於