Class EntityInfo<T>
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
entityNamestringmodelIDGuidpluralNamestringcaptionstringpluralCaptionstringisTransientboolisReferenceDataboolisAbstractboolhasAuditboolisTopLevelboolsectionsFunc<IEnumerable<SectionInfo>>attributesFunc<IEnumerable<AttributeInfo>>relationshipsFunc<IEnumerable<RelationshipInfo>>
Properties
Attributes
Attribute properties by property name.
public IReadOnlyDictionary<string, AttributeInfo> Attributes { get; }
Property Value
AttributesByID
Attribute properties by model ID.
public IReadOnlyDictionary<Guid, AttributeInfo> AttributesByID { get; }
Property Value
Caption
public string Caption { get; }
Property Value
EntityName
public string EntityName { get; }
Property Value
EntityType
public Type EntityType { get; }
Property Value
HasAudit
public bool HasAudit { get; }
Property Value
IsAbstract
public bool IsAbstract { get; }
Property Value
IsReferenceData
public bool IsReferenceData { get; }
Property Value
IsTopLevel
public bool IsTopLevel { get; }
Property Value
IsTransient
public bool IsTransient { get; }
Property Value
ModelID
public Guid ModelID { get; }
Property Value
PluralCaption
public string PluralCaption { get; }
Property Value
PluralName
public string PluralName { get; }
Property Value
Relationships
Relationship properties by property name.
public IReadOnlyDictionary<string, RelationshipInfo> Relationships { get; }
Property Value
Sections
Display sections in display order.
public IReadOnlyList<SectionInfo> Sections { get; }
Property Value
SortAscending
public virtual bool SortAscending { get; }
Property Value
SortProperty
public virtual PropertyInfo SortProperty { get; }
Property Value
Methods
Accept(IVisitor)
Passes the concrete entity type to Visit<T>().
public void Accept(IVisitor visitor)
Parameters
visitorIVisitor
Accept<U>(IVisitor<U>)
Passes the concrete entity type to Visit<T>().
public U Accept<U>(IVisitor<U> visitor)
Parameters
visitorIVisitor<U>
Returns
- U
Type Parameters
U
Construct(IEntityContext, IEntityInitialiser)
protected abstract T Construct(IEntityContext context, IEntityInitialiser initialiser)
Parameters
contextIEntityContextinitialiserIEntityInitialiser
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
contextIEntityContextinitialiserIEntityInitialiser
Returns
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
rowRowThe 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.