Table of Contents

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

metadata EntityMetadataDictionary
logger ILogger

Properties

IsLegacy

public bool IsLegacy { get; }

Property Value

bool

Methods

Measure(Row)

Calculates the actual memory size in bytes of a Row instance.

public uint Measure(Row row)

Parameters

row Row

Returns

uint

Petrify(EntityKernel)

extract a dynamic row data dictionary from an entity for serialisation or transmission

public Row Petrify(EntityKernel entity)

Parameters

entity EntityKernel

Returns

Row

Petrify(IEntity)

public Row Petrify(IEntity entity)

Parameters

entity IEntity

Returns

Row

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

row Row
context IEntityContext

Returns

EntityKernel

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

entityBatches List<List<Row>>
pairBatches List<RelationshipPairs>
context IEntityContext

Returns

ReifiedResult

a ReifiedResult providing access to the entities in the graph

Exceptions

InvalidGraphException

thrown when any element of pairBatches refers to an entity that was neither already loaded in context nor included in entityBatches

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

row Row
context IEntityContext

Returns

T

Type Parameters

T