Compartilhar via


ProtocolJsonSerializer.ToObject<T>(Object, Func<T>) Method

Definition

Convert an object to the desired type using serialization and deserialization.

public static T ToObject<T>(object value, Func<T> defaultFactory = default);
static member ToObject : obj * Func<'T> -> 'T
Public Function ToObject(Of T) (value As Object, Optional defaultFactory As Func(Of T) = Nothing) As T

Type Parameters

T

The type of object to convert to.

Parameters

value
Object

The object to be converted to desired type: string, MemoryStream, object

defaultFactory
Func<T>

Returns

T

The converted object.

Applies to