Entity class

Represents one entity

public class Korzh.EasyQuery.Entity
    : MetaEntity, IComparable<Entity>

Package: Korzh.EasyQuery (targets: netstandard2.0)

Assembly: Korzh.EasyQuery.dll

Properties

Name Type Description
Attributes EntityAttrStore
Model DataModel Gets the model.
ObjType Type
Parent Entity Gets the parent entity.
SubEntities EntityStore
UseInConditions bool Gets or sets a value indicating whether the attribute can be used in query conditions.
UseInResult bool Gets or sets a value indicating whether the attribute can be used in result columns (SELECT clause).
UseInSorting bool Gets or sets a value indicating whether the attribute can be used in sorting.

Methods

Name Type Description
CreateEntityAttrStore() MetaEntityAttrStore
CreateEntityStore() MetaEntityStore
DeleteSubEntities(Func<Entity, bool> entityToDeleteFilter) int Deletes the sub-entities.
FindAttribute(Func<EntityAttr, bool> predicate) EntityAttr
FindAttributeByCaption(string caption) EntityAttr
FindAttributeByExpression(string expr) EntityAttr
FindAttributeById(string id) EntityAttr Finds the attribute by its ID.
FindSubEntity(string entityName) Entity Finds a sub-entity in current entity by its name.
GetFirstLeaf() EntityAttr Gets the first attribute in all attributes and sub-entities of the current entity.
Hide() void Hides this entity (turns off UseInConditions, UseInResult and UseInSorting)
ReadOnePropertyFromJsonAsync(JsonReader reader, string propName) Task Reads one entity property from JSON (asynchronous way) or skips unused.
Scan(Action<Entity> entityHandler, Action<EntityAttr> attrHandler, bool processRoot = True) void Scans all child entities and attributes (including this one one) calls entityHandler and attrHanlder delegates (correspondingly) for each of them
Show() void Shows this entity (turns on UseInConditions, UseInResult and UseInSorting)
WritePropertiesToJsonAsync(JsonWriter writer) Task Writes entity's properties to JSON (asynchronous way).