Table of Contents

Method Deserialize

Namespace
Pinwheel.Vista.Graph
Assembly
Pinwheel.Vista.Runtime.dll

Deserialize<T>(JsonObject, params object[])

Reconstructs one object from its serialized wrapper and optional constructor arguments.

public static T Deserialize<T>(Serializer.JsonObject item, params object[] constructorArgs) where T : class

Parameters

item Serializer.JsonObject

Serialized wrapper containing the runtime type and JSON payload.

constructorArgs object[]

Constructor arguments used when creating the instance before overwriting fields from JSON.

Returns

T

Type Parameters

T

Expected base type of the deserialized object.

Exceptions

ArgumentException

Thrown when the serialized type is invalid or cannot be resolved from loaded assemblies.

Deserialize<T>(IEnumerable<JsonObject>, params object[])

Deserializes a sequence of serialized wrappers, skipping failed items and logging warnings instead of aborting the whole batch.

public static List<T> Deserialize<T>(IEnumerable<Serializer.JsonObject> items, params object[] constructorArgs) where T : class

Parameters

items IEnumerable<Serializer.JsonObject>

Serialized wrappers to reconstruct.

constructorArgs object[]

Constructor arguments forwarded to each object creation call.

Returns

List<T>

Type Parameters

T

Expected base type of the deserialized objects.