Skip to main content

eqexpression-class

Represents common expression object.

public abstract class Korzh.EasyQuery.EqExpression

Assembly: Korzh.EasyQuery.dll

Constructors

NameTypeDescription
EqExpression(DataModel model)voidInitializes a new instance of the Korzh.EasyQuery.EqExpression class.

Fields

NameTypeDescription
_textstringThis field contains expression's text

Properties

NameTypeDescription
AttributeEntityAttrGets or sets the attribute.
CustomFuncstringGets the custom func for expression if defined
DataTypeDataTypeGets or sets the expression's data type.
HasSubQueryboolGets a boolean value indicating whether this expression contains a sub-query.
HintstringGets or sets the expression hint.
IsAggregateboolGets a value indicating whether this expression is an aggregate.
KindDataKindGets the expression kind.
ModelDataModelGets the model.
SystemTypeTypeGets the system type for this expreesion (it's used in LINQ query builder)
TagintGet the expression's tag - a special identifier that is used to distinguish the type of the expression .
TextstringGets or sets the expression text used for visual representation.
ValuestringGets or sets the value of expression.

Events

NameTypeDescription
ContentChangeEventHandlerThis event is raised after expression was changed

Methods

NameTypeDescription
AssignExpr(EqExpression expr)voidAssigns some expression to this one. This method just does nothing in the base class but can perform some actions in Expression descendants.
Clone()EqExpression
CloneAsync(CancellationToken ct = null)Task<EqExpression>
ContentChanged()voidInvoke ContentChange event
LoadFromXmlReader(XmlReader reader)voidLoads expression from XML.
OnContentChange(EventArgs e)voidRaises the ContentChange event.
ReadOnePropFromJsonAsync(JsonReader reader, string propName, CancellationToken ct)TaskReads one expression property from JSON (asynchronous way).
SaveToJsonStringAsync(CancellationToken ct)Task<string>
SaveToXmlWriter(XmlWriter writer, string xmlTagName)voidSaves expression to XML writer.
SaveToXmlWriter(XmlWriter writer)voidSaves expression to XML writer.
SetContent(string val, string txt)voidSets the content of the expression (both its value and text).
SetContentSilent(string val, string txt)voidSets the content of the expression silently (without calling ContentChanged event).
TagToOldClassName(int tag)stringConverts the expression's tag value to the name of old expression class (like "CONST" or "ENTATTR").
WritePropertiesToJsonAsync(JsonWriter writer, CancellationToken ct)TaskWrites all experssion properties to JSON (asynchronous way). This method must be overriden in the descendant classes
WriteToJsonAsync(JsonWriter writer, CancellationToken ct = null)TaskWrite the content of the expression to JSON (asynchronous way).
WriteXmlTagStart(XmlWriter writer)voidWrites the expression XML tag start.
WriteXmlTagStart(XmlWriter writer, string tagName)voidWrites the expression XML tag start.

Static Properties

NameTypeDescription
XmlTagNamestringGets the name of the XML tag used for representation of Expression (an all its descendants) object in XML files.

Static Methods

NameTypeDescription
Create(DataModel model, int tag)EqExpressionCreates the expression instance of specified type.
CreateByClassName(DataModel model, string className)EqExpressionCreates the expression instance of specified class (type) name.
ReadFromJsonAsync(DataModel model, JsonReader reader, CancellationToken ct = null)Task<EqExpression>Reads one expression from JSON.(asynchronous way). This static function recognizes the expression type and creates an instance of appropriate class.
RegisterCreator(IExpressionCreator creator)boolRegisters new type of expression.