BinaryData.ToObjectFromJson 方法

定义

重载

名称 说明
ToObjectFromJson<T>(JsonSerializerOptions)

使用 JsonSerializer. 将BinaryData指定类型转换为指定类型。

ToObjectFromJson<T>(JsonTypeInfo<T>)

使用 JsonSerializer. 将BinaryData指定类型转换为指定类型。

ToObjectFromJson<T>(JsonSerializerOptions)

Source:
BinaryData.cs
Source:
BinaryData.cs
Source:
BinaryData.cs
Source:
BinaryData.cs

使用 JsonSerializer. 将BinaryData指定类型转换为指定类型。

[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed.")]
public T? ToObjectFromJson<T>(System.Text.Json.JsonSerializerOptions? options = default);
public T? ToObjectFromJson<T>(System.Text.Json.JsonSerializerOptions? options = default);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed.")>]
member this.ToObjectFromJson : System.Text.Json.JsonSerializerOptions -> 'T
member this.ToObjectFromJson : System.Text.Json.JsonSerializerOptions -> 'T
Public Function ToObjectFromJson(Of T) (Optional options As JsonSerializerOptions = Nothing) As T

类型参数

T

应将数据转换为的类型。

参数

options
JsonSerializerOptions

JsonSerializerOptions序列化为 JSON 时要使用的。

返回

T

转换为指定类型的数据。

属性

适用于

ToObjectFromJson<T>(JsonTypeInfo<T>)

Source:
BinaryData.cs
Source:
BinaryData.cs
Source:
BinaryData.cs
Source:
BinaryData.cs

使用 JsonSerializer. 将BinaryData指定类型转换为指定类型。

public:
generic <typename T>
 T ToObjectFromJson(System::Text::Json::Serialization::Metadata::JsonTypeInfo<T> ^ jsonTypeInfo);
public T? ToObjectFromJson<T>(System.Text.Json.Serialization.Metadata.JsonTypeInfo<T> jsonTypeInfo);
member this.ToObjectFromJson : System.Text.Json.Serialization.Metadata.JsonTypeInfo<'T> -> 'T
Public Function ToObjectFromJson(Of T) (jsonTypeInfo As JsonTypeInfo(Of T)) As T

类型参数

T

应将数据转换为的类型。

参数

jsonTypeInfo
JsonTypeInfo<T>

JsonTypeInfo序列化为 JSON 时要使用的。

返回

T

转换为指定类型的数据。

适用于