Class LitBlock
A literal value in a query, coerced on construction to the data type it is being compared against.
public class LitBlock : BaseBlock
- Inheritance
-
LitBlock
- Inherited Members
Constructors
LitBlock(object?, DataType?)
Create a literal and coerce it to the given data type.
public LitBlock(object? value, DataType? dataType)
Parameters
valueobjectThe value as it arrived from the client, usually a string or a boxed number.
dataTypeDataTypeThe type to coerce to, normally taken from the other side of the comparison; null leaves the value as it is.
Properties
DataType
The data type the literal was coerced to, or null if none was known.
public override DataType? DataType { get; }
Property Value
Methods
GetValue()
The value after coercion - what the generated expression will compare against.
public object? GetValue()
Returns
ToExpression(Expression)
Build the constant expression for this literal.
public override Expression ToExpression(Expression inExpr)
Parameters
inExprExpressionThe expression the block is applied to. Unused here - a literal does not depend on the row.
Returns
- Expression
A ConstantExpression holding the coerced value.