BinaryData.FromObjectAsJson 方法

定义

重载

名称 说明
FromObjectAsJson<T>(T, JsonTypeInfo<T>)

通过使用 /> 序列化所提供的对象来创建实例。

FromObjectAsJson<T>(T, JsonSerializerOptions)

通过使用 /> 序列化所提供的对象来创建实例。

FromObjectAsJson<T>(T, JsonTypeInfo<T>)

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

通过使用 /> 序列化所提供的对象来创建实例。

public:
generic <typename T>
 static BinaryData ^ FromObjectAsJson(T jsonSerializable, System::Text::Json::Serialization::Metadata::JsonTypeInfo<T> ^ jsonTypeInfo);
public static BinaryData FromObjectAsJson<T>(T jsonSerializable, System.Text.Json.Serialization.Metadata.JsonTypeInfo<T> jsonTypeInfo);
static member FromObjectAsJson : 'T * System.Text.Json.Serialization.Metadata.JsonTypeInfo<'T> -> BinaryData
Public Shared Function FromObjectAsJson(Of T) (jsonSerializable As T, jsonTypeInfo As JsonTypeInfo(Of T)) As BinaryData

类型参数

T

序列化数据时要使用的类型。

参数

jsonSerializable
T

要使用的数据。

jsonTypeInfo
JsonTypeInfo<T>

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

返回

一个表示 JSON 表示形式的 UTF-8 编码的值 jsonSerializable

另请参阅

适用于

FromObjectAsJson<T>(T, JsonSerializerOptions)

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

通过使用 /> 序列化所提供的对象来创建实例。

[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 static BinaryData FromObjectAsJson<T>(T jsonSerializable, System.Text.Json.JsonSerializerOptions? options = default);
public static BinaryData FromObjectAsJson<T>(T jsonSerializable, 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.")>]
static member FromObjectAsJson : 'T * System.Text.Json.JsonSerializerOptions -> BinaryData
static member FromObjectAsJson : 'T * System.Text.Json.JsonSerializerOptions -> BinaryData
Public Shared Function FromObjectAsJson(Of T) (jsonSerializable As T, Optional options As JsonSerializerOptions = Nothing) As BinaryData

类型参数

T

序列化数据时要使用的类型。

参数

jsonSerializable
T

要使用的数据。

options
JsonSerializerOptions

序列化为 JSON 时要使用的选项。

返回

一个表示 JSON 表示形式的 UTF-8 编码的值 jsonSerializable

属性

另请参阅

适用于