语言

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 源生成器的输出使用,不应直接调用。

适用于