Class EntityFactory
- Namespace
- The.Persistence
- Assembly
- Instagile.dll
Creates, serialises and deserialises entity graphs from dynamic row data.
public sealed class EntityFactory
- Inheritance
-
EntityFactory
- Inherited Members
Constructors
EntityFactory(EntityMetadataDictionary, ILogger)
public EntityFactory(EntityMetadataDictionary metadata, ILogger logger)
Parameters
metadataEntityMetadataDictionaryloggerILogger
Properties
IsLegacy
public bool IsLegacy { get; }
Property Value
Methods
Measure(Row)
Calculates the actual memory size in bytes of a Row instance.
public uint Measure(Row row)
Parameters
rowRow
Returns
Petrify(EntityKernel)
extract a dynamic row data dictionary from an entity for serialisation or transmission
public Row Petrify(EntityKernel entity)
Parameters
entityEntityKernel
Returns
Petrify(IEntity)
public Row Petrify(IEntity entity)
Parameters
entityIEntity
Returns
Reify(Row?, IEntityContext)
build an entity from a dynamic row data dictionary by constructing it in a context
public EntityKernel? Reify(Row? row, IEntityContext context)
Parameters
rowRowcontextIEntityContext
Returns
ReifyGraph(List<List<Row?>>, List<RelationshipPairs>, IEntityContext)
build an entity graph from dynamic row data dictionaries and collection mappings by constructing them in a context
public ReifiedResult ReifyGraph(List<List<Row?>> entityBatches, List<RelationshipPairs> pairBatches, IEntityContext context)
Parameters
entityBatchesList<List<Row>>pairBatchesList<RelationshipPairs>contextIEntityContext
Returns
- ReifiedResult
a ReifiedResult providing access to the entities in the graph
Exceptions
- InvalidGraphException
thrown when any element of
pairBatchesrefers to an entity that was neither already loaded incontextnor included inentityBatches
Reify<T>(Row?, IEntityContext)
build an entity from a dynamic row data dictionary by constructing it in a context
public T? Reify<T>(Row? row, IEntityContext context) where T : IEntity
Parameters
rowRowcontextIEntityContext
Returns
- T
Type Parameters
T