Skip to main content

entity-class

Represents one entity

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

Assembly: Korzh.EasyQuery.dll

Properties

NameTypeDescription
AttributesEntityAttrStore
ModelDataModelGets the model.
ObjTypeType
ParentEntityGets the parent entity.
SubEntitiesEntityStore
UseInConditionsboolGets or sets a value indicating whether the attribute can be used in query conditions.
UseInResultboolGets or sets a value indicating whether the attribute can be used in result columns (SELECT clause).
UseInSortingboolGets or sets a value indicating whether the attribute can be used in sorting.

Methods

NameTypeDescription
CreateEntityAttrStore()MetaEntityAttrStore
CreateEntityStore()MetaEntityStore
DeleteSubEntities(Func<Entity, bool> entityToDeleteFilter)intDeletes the sub-entities.
FindAttribute(Func<EntityAttr, bool> predicate)EntityAttr
FindAttributeByCaption(string caption)EntityAttr
FindAttributeByExpression(string expr)EntityAttr
FindAttributeById(string id)EntityAttrFinds the attribute by its ID.
FindSubEntity(string entityName)EntityFinds a sub-entity in current entity by its name.
GetFirstLeaf()EntityAttrGets the first attribute in all attributes and sub-entities of the current entity.
Hide()voidHides this entity (turns off UseInConditions, UseInResult and UseInSorting)
ReadOnePropertyFromJsonAsync(JsonReader reader, string propName, CancellationToken ct)TaskReads one entity property from JSON (asynchronous way) or skips unused.
Scan(Action<Entity> entityHandler, Action<EntityAttr> attrHandler, bool processRoot = True)voidScans all child entities and attributes (including this one one) calls entityHandler and attrHanlder delegates (correspondingly) for each of them
Show()voidShows this entity (turns on UseInConditions, UseInResult and UseInSorting)
WritePropertiesToJsonAsync(JsonWriter writer, CancellationToken ct)TaskWrites entity's properties to JSON (asynchronous way).