BinaryData.FromObjectAsJson Method
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.
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. |
- Source:
- BinaryData.cs
- Source:
- BinaryData.cs
- Source:
- BinaryData.cs
Creates a BinaryData instance by serializing the provided object using the JsonSerializer.
public static BinaryData FromObjectAsJson<T> (T jsonSerializable, System.Text.Json.JsonSerializerOptions? options = default);
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
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) |
- Source:
- BinaryData.cs
- Source:
- BinaryData.cs
- Source:
- BinaryData.cs
Creates a BinaryData instance by serializing the provided object using the JsonSerializer.
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
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) |
.NET feedback
.NET is an open source project. Select a link to provide feedback: