Class BaseBlock
One side of a comparison in a where clause, once parsed: a property reference (PropBlock), a literal (LitBlock), or a function call (FnBlock).
public abstract class BaseBlock
- Inheritance
-
BaseBlock
- Derived
- Inherited Members
Properties
DataType
The data type this side of the comparison yields, or null when it cannot be determined - as for a null literal.
public abstract DataType? DataType { get; }
Property Value
Methods
CreateLHSBlock(object, Type)
Parse the left-hand side of a predicate.
public static BaseBlock CreateLHSBlock(object exprSource, Type entityType)
Parameters
exprSourceobjectThe left-hand side as it arrived from the client.
entityTypeTypeThe entity type being queried.
Returns
Remarks
Only a string is accepted here: either a property path, or a function call such as "toupper(CompanyName)". Literals, objects and arrays are legal only on the right.
Exceptions
- Exception
The value is null, an object, an array, or any other non-string.
CreateRHSBlock(object?, Type, DataType?)
Parse the right-hand side of a predicate.
public static BaseBlock CreateRHSBlock(object? exprSource, Type entityType, DataType? otherExprDataType)
Parameters
exprSourceobjectThe right-hand side as it arrived from the client; null yields a null literal.
entityTypeTypeThe entity type being queried. When null, strings are taken as literals.
otherExprDataTypeDataTypeThe data type of the left-hand side, used to coerce a literal.
Returns
Remarks
This side is permissive: a literal, the name of another property to compare against, an array for an 'in' clause, or an object carrying an explicit "value" together with either "dataType" or "isProperty". A bare string is read as a property if the entity type has one by that name, and as a literal otherwise.
Exceptions
- Exception
The value is an object with no "value" property, or of a type that cannot appear here.
ToExpression(Expression)
Build the LINQ expression for this block.
public abstract Expression ToExpression(Expression inExpr)
Parameters
inExprExpressionThe query's lambda parameter.
Returns
- Expression
The expression that produces this side's value.