Class ModelEntityBaseJsonConverter
- Namespace
- TimeCockpit.Data.JsonConverters
- Assembly
- TimeCockpit.Data.dll
Custom converter for ModelEntityBases into Json.
public class ModelEntityBaseJsonConverter : CustomCreationConverter<ModelEntityBase>
- Inheritance
-
ObjectModelEntityBaseJsonConverter
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
objectTypeTypeType 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
readerJsonReaderthe reader to read from.
modelModelThe 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
writerJsonWriterthe writer to write to.
modelModelThe model.
anonymousTypesIEnumerable<ModelEntityBase>ModelEntityBase types to serialize.