BinaryData.FromObjectAsJson Method

Definition

Overloads

FromObjectAsJson<T>(T, JsonSerializerOptions)

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

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

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

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 9 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

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 9 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)