DataModel class

Represents a data model

public class Korzh.EasyQuery.DataModel
    : MetaData

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

Assembly: Korzh.EasyQuery.dll

Constructors

Name Type Description
DataModel() void Initializes a new instance of the Korzh.EasyQuery.DataModel class.

Fields

Name Type Description
AggrFunctions AggrFunctionList List of aggregate functions.
DMEOptions Dictionary<string, string> A dictionary that contains different Data Model Editor options associated with this model
Macros MacroList List of macro values
XmlSerializer DataModelXmlSerializer

Properties

Name Type Description
DefaultPreciseDateEditor ValueEditor Gets the default "precise date" editor.
DefaultPreciseTimeEditor ValueEditor Gets the default "precise time" editor.
DefaultSpecialDatesEditor ValueEditor Gets the default editor that returns the list of the special dates (Today, Yesterday, First day of month, etc).
DefaultSpecialTimesEditor ValueEditor Gets the default editor that returns the list of the special times (Midnight, Noon, etc).
DefaultTextEditor ValueEditor Gets the default text editor.
DefQueryFilePath string Gets or sets the file path for default (blank) query used with this data model.
EntityGraph EntityGraph Represents the graph of entities we operate with in this model This property is mostly used in LINQ query bulder
EntityRoot Entity
FormatVersionXml int Gets the version of data model XML format.
ID string Gets or sets the ID of the model
NullOperator Operator Gets the null operator.
Operators OperatorStore List of data model operators.
Texts TextStorage Gets an instance of TextStorage object which holds all text resources used in this assembly
UseResourcesForOperators bool Gets or sets a value indicating whether we get the main parameters (caption and format) for default operators from resources.

Events

Name Type Description
AggrFuncListChanged AggrFuncListChangedEventHandler Occurs when the list of available aggregate functions was changed.
MacroRequest MacroRequestEventHandler This event is raised when a value for some macro is requested.

Methods

Name Type Description
AddDefaultEditors() void Adds the default value editors.
AddDefaultOperators() void Adds the default operators into model
AddEntityAttr(EntityAttrDescriptor desc) EntityAttr Adds a new attribute to the model.
AddOperatorToEntity(Operator op, Entity ent) void Adds the operator to all suitable attributes in specified entity.
AddOperatorToSuitedAttributes(Operator op) void Adds the operator to all suitable (by data type) attributes.
AddUpdateOperator(string id, string caption, string expr, string format, DataKind kind = 0, OperatorGroup group = null) Operator Adds or update an operator.
Clear() void Clears this instance.
Clone() DataModel Clones the model object
CreateEntity(Entity parentEntity = null) Entity Creates the entity.
CreateEntityAttr(EntityAttrDescriptor desc) EntityAttr Creates the entity attribute. Used for creating entity attributes while building the model
CreateEntityAttrCore(MetaEntity parent, EntityAttrKind kind) MetaEntityAttr
CreateEntityCore(MetaEntity parent) MetaEntity
CreateNullOperator() Operator Creates the null operator. U
CreateOperator() Operator Creates the operator. Used for creating objects while building the model
CreateOperator(string id, string caption, string expr, string format) Operator Creates the operator. Used for creating objects while building the model
CreateQuery(Query parentQuery = null) Query Creates a Query object associated with this model
CreateRootEntity() Entity Creates the root entity. This method can be overriden in descendant classes to retrun the object of appropriate class (e.g. DbEntity).
CreateRootEntityCore() MetaEntity
DeleteOperatorFromEntity(Entity ent, Operator op) void Deletes the operator from any attribute of specified entity (and all its sub-entities).
EnsureEditorExistance(ValueEditor editor) void Ensures the existance of value editor.
FindEntity(string entityName) Entity Finds an entity by its name.
FindEntityAttr(string attrDef) EntityAttr Finds the entity attribute.
GetAttributeById(string attrID, bool useNullAttr) EntityAttr
GetDefaultOperatorsForDataType(DataType dataType) OperatorList Returns the list of default operators for some data type
GetMacroValue(string macroId) IMacroValue Gets the value of the macro by its ID.
ListDefaultOperatorsForDataType(OperatorList operats, DataType dataType) void Fills the list with default operators for some data type
LoadFromXmlFile(string filePath) void Loads data model from XML file.
LoadFromXmlFile(string filePath, BitOptions options) void Loads data model from XML file.
LoadFromXmlReader(XmlReader reader) void Loads data model from XML reader.
LoadFromXmlReader(XmlReader reader, BitOptions options) void Loads data model from XML reader.
LoadFromXmlStream(Stream stream) void Loads data model from XML stream.
LoadFromXmlStream(Stream stream, BitOptions options) void Loads data model from XML stream.
LoadFromXmlString(string xml) void Loads data model from XML string.
LoadFromXmlString(string xml, BitOptions options) void Loads data model from XML string.
OnAggrFuncListChanged() void Raises the AggrFuncListChanged event.
OnDocketRequest(MacroRequestEventArgs e) bool Raises the MacroRequest event.
OnModelLoaded() void
ReadOneModelPropFromJsonAsync(JsonReader reader, string propName) Task Reads one model property from JSON (asynchronous way).
RefillAggrFunctionList() void Refills the list of aggregate functions.
RefreshResources() void Re-loads the string values from Korzh.EasyQuery.DataModel.Texts list.
SaveToXmlFile(string filePath) void Saves data model XML to file.
SaveToXmlFile(string path, BitOptions options) void Saves data model XML to file.
SaveToXmlStream(Stream stream) void Saves data model XML to stream.
SaveToXmlStream(Stream stream, BitOptions options) void Saves data model XML to stream.
SaveToXmlString() string Saves data model XML specification to string object.
SaveToXmlString(BitOptions options) string Saves data model XML specification to string object.
SaveToXmlWriter(XmlWriter writer) void Saves data model specification using XmlWriter.
SaveToXmlWriter(XmlWriter writer, BitOptions options) void Saves data model specification using XmlWriter.
UpdateOperatorsTexts() void Loads the text for all default operators from resources.
UpdateOperatorTexts(Operator op) void Loads the texts for one operator from resources (Texts storage actually)
Validate() void Validates this model and throws an exception if something is wrong.
WriteContentToJsonAsync(JsonWriter writer, BitOptions options) Task Writes the main content of the model to JSON (asynchronous way).
WriteModelPropsToJsonAsync(JsonWriter writer, BitOptions options) Task

Static Fields

Name Type Description
AnyOperatorGroup OperatorGroup Gets the special group which contain any operator
BoolOperatorGroup OperatorGroup Gets the group which contains the date/time operators (before, after, between, etc.)
CommonOperatorGroup OperatorGroup Gets the group which contains the common operators (equal, not equal, less than, more than, etc)
LastXmlFormatVersion int Read-only constant that represent the latest format version for data model definition XML files
OperatorGroups OperatorGroupList Gets the list of all predefined operator groups
OtherOperatorGroup OperatorGroup Gets the group which contains other operators not included in any of the previous group
StringOperatorGroup OperatorGroup Gets the group which contains the string operators (starts with, contains)
TimeOperatorGroup OperatorGroup Gets the group which contains the date/time operators (before, after, between, etc.)