Skip to content

MetaEntity class

Represents one entity

public class EasyData.MetaEntity
: IComparable<MetaEntity>

Package: EasyData.Core (targets: netstandard2.0)

Assembly: EasyData.Core.dll

NameTypeDescription
_modelMetaData
AttributesMetaEntityAttrStoreList of Attributes that belong to this entity.
ClrTypeTypeGets or sets the type of the entity.
DbSetNamestringGets or sets the name of the DbSet associated with entity
DescriptionstringGets or sets the description.
IdstringGets or sets the entity identifier
IndexintGets or sets the index of Entity
IsEmptyboolGets a value indicating whether this instance is empty.
IsRootboolGets a value indicating whether this entity is a root entity.
ModelMetaDataGets the model.
NamestringGets or sets the name of the entity.
NamePluralstringGets or sets the name of the entity in plural form.
ParentMetaEntityGets the parent entity.
SubEntitiesMetaEntityStoreList of sub entities that belong to this entity.
TypeNamestringGets or sets the path for building query for complex types
UserDataobjectGets or sets the user data object associated with entity.
NameTypeDescription
CreateEntityAttrStore()MetaEntityAttrStore
CreateEntityStore()MetaEntityStore
DeleteSubEntities(String[] namesToDelete)intDeletes the sub-entities specified by name(s) passed in method’s parameter(s).
DeleteSubEntities(Func<MetaEntity, bool> entityToDeleteFilter)intDeletes the sub-entities specified by name(s) passed in method’s parameter(s).
FindAttribute(Func<MetaEntityAttr, bool> predicate)MetaEntityAttr
FindAttributeByCaption(string caption)MetaEntityAttr
FindAttributeByExpression(string expr)MetaEntityAttr
FindAttributeById(string id)MetaEntityAttr
FindSubEntity(string entityName)MetaEntityFinds a sub-entity in current entity by its name.
GetFirstLeaf()MetaEntityAttrGets the first attribute in all attributes and sub-entities of the current entity.
GetFullName(string separator)stringGets the full name.
ReadFromJsonAsync(JsonReader reader)TaskReads the entity content from JSON (asynchronous way).
ReadOnePropertyFromJsonAsync(JsonReader reader, string propName)TaskReads one entity property from JSON (asynchronous way) or skips unused.
Scan(Action<MetaEntity> entityHandler, Action<MetaEntityAttr> attrHandler, bool processRoot = True)voidScans all child entities and attributes (including this one one) calls entityHandler and attrHanlder delegates (correspondingly) for each of them
WritePropertiesToJsonAsync(JsonWriter writer)TaskWrites entity’s properties to JSON (asynchronous way).
WriteToJsonAsync(JsonWriter writer, BitOptions options)TaskWrites the content of the entity to JSON (asynchronious way)