Auf Englisch lesen Bearbeiten

Freigeben über


BinaryData.FromObjectAsJson Method

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Overloads

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

Creates a BinaryData instance by serializing the provided object using the JsonSerializer.

FromObjectAsJson<T>(T, JsonSerializerOptions)

Creates a BinaryData instance by serializing the provided object using the JsonSerializer.

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

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

Creates a BinaryData instance by serializing the provided object using the JsonSerializer.

C#
public static BinaryData FromObjectAsJson<T>(T jsonSerializable, System.Text.Json.Serialization.Metadata.JsonTypeInfo<T> jsonTypeInfo);

Type Parameters

T

The type to use when serializing the data.

Parameters

jsonSerializable
T

The data to use.

jsonTypeInfo
JsonTypeInfo<T>

The JsonTypeInfo to use when serializing to JSON.

Returns

A value representing the UTF-8 encoding of the JSON representation of jsonSerializable.

Applies to

.NET 10 (package-provided) und andere Versionen
Produkt Versionen
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided)

FromObjectAsJson<T>(T, JsonSerializerOptions)

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

Creates a BinaryData instance by serializing the provided object using the JsonSerializer.

C#
public static BinaryData FromObjectAsJson<T>(T jsonSerializable, System.Text.Json.JsonSerializerOptions? options = default);

Type Parameters

T

The type to use when serializing the data.

Parameters

jsonSerializable
T

The data to use.

options
JsonSerializerOptions

The options to use when serializing to JSON.

Returns

A value representing the UTF-8 encoding of the JSON representation of jsonSerializable.

Applies to

.NET 10 (package-provided) und andere Versionen
Produkt Versionen
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided)