Table of Contents

Class BaseBlock

Namespace
Breeze.Core
Assembly
Breeze.Core.dll

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

DataType

Methods

CreateLHSBlock(object, Type)

Parse the left-hand side of a predicate.

public static BaseBlock CreateLHSBlock(object exprSource, Type entityType)

Parameters

exprSource object

The left-hand side as it arrived from the client.

entityType Type

The entity type being queried.

Returns

BaseBlock

A PropBlock, or an FnBlock if the string contains a call.

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

exprSource object

The right-hand side as it arrived from the client; null yields a null literal.

entityType Type

The entity type being queried. When null, strings are taken as literals.

otherExprDataType DataType

The data type of the left-hand side, used to coerce a literal.

Returns

BaseBlock

A PropBlock or a LitBlock.

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

inExpr Expression

The query's lambda parameter.

Returns

Expression

The expression that produces this side's value.