Entity class

Represents one entity

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

Properties

Type Name Description
EntityAttrStore Attributes List of Attributes that belong to this entity.
String DbSetName Gets or sets the name of the DbSet associated with entity
String Description Gets or sets the description.
String Id Gets or sets the entity identifier
Boolean IsEmpty Gets a value indicating whether this instance is empty.
Boolean IsRoot Gets a value indicating whether this entity is a root entity.
DataModel Model Gets the model.
String Name Gets or sets the name of the entity.
Type ObjType Gets or sets the type of the entity.
Entity Parent Gets the parent entity.
EntityStore SubEntities List of sub entities that belong to this entity.
String TypeName Gets or sets the path for building query for complex types
Boolean UseInConditions Gets or sets a value indicating whether the attribute can be used in query conditions.
Boolean UseInResult Gets or sets a value indicating whether the attribute can be used in result columns (SELECT clause).
Boolean UseInSorting Gets or sets a value indicating whether the attribute can be used in sorting.
Object UserData Gets or sets the user data object associated with entity.

Methods

Type Name Description
EntityAttr FindAttribute(EntityAttrProp what, String val) Finds the attribute by its ID.
Entity FindSubEntity(String entityName) Finds a sub-entity in current entity by its name.
EntityAttr GetFirstLeaf() Gets the first attribute in all attributes and sub-entities of the current entity.
String GetFullName(String separator) Gets the full name.
void LoadAttribute(String propname, String propvalue) Loads the attribute of the entity.
void LoadFromXmlReader(XmlReader reader) Loads entity from XML reader.
void LoadNodes(XmlReader reader) Loads the root nodes of the entity.
void OnModelAssignment() Called when the entity is inserted into model.
void ReadFromJson(JsonReader reader) Reads the entity content from JSON.
Task ReadFromJsonAsync(JsonReader reader) Reads the entity content from JSON (asynchronous way).
void ReadOnePropertyFromJson(JsonReader reader, String propName) Reads one entity property from JSON or skips unused.
Task ReadOnePropertyFromJsonAsync(JsonReader reader, String propName) Reads one entity property from JSON (asynchronous way) or skips unused.
void SaveAttributes(XmlWriter writer) Saves the entity attributes.
void SaveNodes(XmlWriter writer) Saves the entity nodes.
void SaveToXmlWriter(XmlWriter writer) Saves the entity to XML writer.
void Scan(Action<Entity> entityHandler, Action<EntityAttr> attrHandler, Boolean processRoot = True) Scans all child entities and attributes (including this one one) calls entityHandler and attrHanlder delegates (correspondingly) for each of them
void WritePropertiesToJson(JsonWriter writer) Writes entity's properties to JSON
Task WritePropertiesToJsonAsync(JsonWriter writer) Writes entity's properties to JSON (asynchronous way).
void WriteToJson(JsonWriter writer, ModelReadWriteOptions rwOptions) Writes the content of the entity to JSON.
Task WriteToJsonAsync(JsonWriter writer, ModelReadWriteOptions rwOptions) Writes the content of the entity to JSON (asynchronious way)