Share via


VisualizerObjectSource.DeserializeFromJson Method

Definition

Overloads

DeserializeFromJson(Stream, Type, Object)

Deserializes the data in JSON format from the specified stream into an object of a specific type using the Newtonsoft.Json library.

DeserializeFromJson<T>(Stream, Object)

Deserializes the data in JSON format from the specified stream into an object of a specific type using the Newtonsoft.Json library.

DeserializeFromJson(Stream, Type, Object)

Deserializes the data in JSON format from the specified stream into an object of a specific type using the Newtonsoft.Json library.

public static object? DeserializeFromJson (System.IO.Stream serializationStream, Type dataType, object? serializer = default);
static member DeserializeFromJson : System.IO.Stream * Type * obj -> obj
Public Shared Function DeserializeFromJson (serializationStream As Stream, dataType As Type, Optional serializer As Object = Nothing) As Object

Parameters

serializationStream
Stream

The stream where the data will be extracted from.

dataType
Type

The type of the object that will be created from the data in the stream.

serializer
Object

[Optional] Argument of type Newtonsoft.Json.JsonSerializer that specifies how the object will be encoded as JSON. If not specified, the object will be deserialized with the default NewtonSoft JSON Serializer.

Returns

An object of the specified dataType initialized with the data contained in the stream.

Exceptions

If the data in the stream is not formatted as valid JSON.

Applies to

DeserializeFromJson<T>(Stream, Object)

Deserializes the data in JSON format from the specified stream into an object of a specific type using the Newtonsoft.Json library.

public static T? DeserializeFromJson<T> (System.IO.Stream serializationStream, object? serializer = default);
static member DeserializeFromJson : System.IO.Stream * obj -> 'T
Public Shared Function DeserializeFromJson(Of T) (serializationStream As Stream, Optional serializer As Object = Nothing) As T

Type Parameters

T

Parameters

serializationStream
Stream

The stream where the data will be extracted from.

serializer
Object

[Optional] Argument of type Newtonsoft.Json.JsonSerializer that specifies how the object will be encoded as JSON. If not specified, the object will be deserialized with the default NewtonSoft JSON Serializer.

Returns

T

An object of the specified dataType initialized with the data contained in the stream.

Exceptions

If the data in the stream is not formatted as valid JSON.

Applies to