Table of Contents

Class ModelEntityBaseJsonConverter

Namespace
TimeCockpit.Data.JsonConverters
Assembly
TimeCockpit.Data.dll

Custom converter for ModelEntityBases into Json.

public class ModelEntityBaseJsonConverter : CustomCreationConverter<ModelEntityBase>
Inheritance
Object
ModelEntityBaseJsonConverter

Remarks

This converter creates a new instance of ModelEntity whenever the Json.Net serializer encounters a ModelEntityBase to deserialize.

Constructors

ModelEntityBaseJsonConverter()

public ModelEntityBaseJsonConverter()

Methods

Create(Type)

Creates the specified object type.

public override ModelEntityBase Create(Type objectType)

Parameters

objectType Type

Type of the object.

Returns

ModelEntityBase

an instance of ModelEntity.

ReadAnonymousTypeArray(JsonReader, Model)

Reads an array of model entity base instances

public static IEnumerable<ModelEntityBase> ReadAnonymousTypeArray(JsonReader reader, Model model)

Parameters

reader JsonReader

the reader to read from.

model Model

The model.

Returns

IEnumerable<ModelEntityBase>

Returns a collection of model entity base.

WriteAnonymousTypeArray(JsonWriter, Model, IEnumerable<ModelEntityBase>)

Writes a collection of model entity base types to the writer.

public static void WriteAnonymousTypeArray(JsonWriter writer, Model model, IEnumerable<ModelEntityBase> anonymousTypes)

Parameters

writer JsonWriter

the writer to write to.

model Model

The model.

anonymousTypes IEnumerable<ModelEntityBase>

ModelEntityBase types to serialize.