Table of Contents

Class EntityInfo<T>

Namespace
The.Entities
Assembly
Instagile.dll

Describes the metadata and construction logic for a specific entity type.

public abstract class EntityInfo<T> : IEntityInfo where T : IEntity<T>

Type Parameters

T
Inheritance
EntityInfo<T>
Implements
Inherited Members
Extension Methods

Constructors

EntityInfo(string, Guid, string, string, string, bool, bool, bool, bool, bool, Func<IEnumerable<SectionInfo>>, Func<IEnumerable<AttributeInfo>>, Func<IEnumerable<RelationshipInfo>>)

public EntityInfo(string entityName, Guid modelID, string pluralName, string caption, string pluralCaption, bool isTransient, bool isReferenceData, bool isAbstract, bool hasAudit, bool isTopLevel, Func<IEnumerable<SectionInfo>> sections, Func<IEnumerable<AttributeInfo>> attributes, Func<IEnumerable<RelationshipInfo>> relationships)

Parameters

entityName string
modelID Guid
pluralName string
caption string
pluralCaption string
isTransient bool
isReferenceData bool
isAbstract bool
hasAudit bool
isTopLevel bool
sections Func<IEnumerable<SectionInfo>>
attributes Func<IEnumerable<AttributeInfo>>
relationships Func<IEnumerable<RelationshipInfo>>

Properties

Attributes

Attribute properties by property name.

public IReadOnlyDictionary<string, AttributeInfo> Attributes { get; }

Property Value

IReadOnlyDictionary<string, AttributeInfo>

AttributesByID

Attribute properties by model ID.

public IReadOnlyDictionary<Guid, AttributeInfo> AttributesByID { get; }

Property Value

IReadOnlyDictionary<Guid, AttributeInfo>

Caption

public string Caption { get; }

Property Value

string

EntityName

public string EntityName { get; }

Property Value

string

EntityType

public Type EntityType { get; }

Property Value

Type

HasAudit

public bool HasAudit { get; }

Property Value

bool

IsAbstract

public bool IsAbstract { get; }

Property Value

bool

IsReferenceData

public bool IsReferenceData { get; }

Property Value

bool

IsTopLevel

public bool IsTopLevel { get; }

Property Value

bool

IsTransient

public bool IsTransient { get; }

Property Value

bool

ModelID

public Guid ModelID { get; }

Property Value

Guid

PluralCaption

public string PluralCaption { get; }

Property Value

string

PluralName

public string PluralName { get; }

Property Value

string

Relationships

Relationship properties by property name.

public IReadOnlyDictionary<string, RelationshipInfo> Relationships { get; }

Property Value

IReadOnlyDictionary<string, RelationshipInfo>

Sections

Display sections in display order.

public IReadOnlyList<SectionInfo> Sections { get; }

Property Value

IReadOnlyList<SectionInfo>

SortAscending

public virtual bool SortAscending { get; }

Property Value

bool

SortProperty

public virtual PropertyInfo SortProperty { get; }

Property Value

PropertyInfo

Methods

Accept(IVisitor)

Passes the concrete entity type to Visit<T>().

public void Accept(IVisitor visitor)

Parameters

visitor IVisitor

Accept<U>(IVisitor<U>)

Passes the concrete entity type to Visit<T>().

public U Accept<U>(IVisitor<U> visitor)

Parameters

visitor IVisitor<U>

Returns

U

Type Parameters

U

Construct(IEntityContext, IEntityInitialiser)

protected abstract T Construct(IEntityContext context, IEntityInitialiser initialiser)

Parameters

context IEntityContext
initialiser IEntityInitialiser

Returns

T

ConstructEntity(IEntityContext, IEntityInitialiser)

Creates a concrete entity given a context from a framework instance and a source of row data.

public IEntity ConstructEntity(IEntityContext context, IEntityInitialiser initialiser)

Parameters

context IEntityContext
initialiser IEntityInitialiser

Returns

IEntity

EstimateRowSize()

Estimates the maximum memory size in bytes a Row could occupy. Uses MaxLength for strings/blobs instead of actual values. Does not require a Row instance.

public abstract uint EstimateRowSize()

Returns

uint

Estimated maximum size in bytes

MeasureRowSize(Row)

Calculates the actual memory size in bytes of a Row instance. Includes object overhead and actual string/blob lengths.

public abstract uint MeasureRowSize(Row row)

Parameters

row Row

The Row instance to measure

Returns

uint

Size in bytes

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.