Table of Contents

Class BinaryPredicate

Namespace
Breeze.Core
Assembly
Breeze.Core.dll

A where clause comparing two operands - a property against a literal, or a property against another property.

public class BinaryPredicate : BasePredicate
Inheritance
BinaryPredicate
Inherited Members

Remarks

Validate(Type) does the work of deciding what each side is, including coercing literals to the property's type and handling enums and 'in' lists.

Constructors

BinaryPredicate(Operator, object, object?)

Compare two operands with an operator.

public BinaryPredicate(Operator op, object expr1Source, object? expr2Source)

Parameters

op Operator

The comparison to apply.

expr1Source object

The left-hand operand.

expr2Source object

The right-hand operand; null compares against null.

Properties

Expr1Source

The left-hand operand as the client wrote it - a property path, or a function call.

public object Expr1Source { get; }

Property Value

object

Expr2Source

The right-hand operand as the client wrote it - a literal, a property path, or an array for 'in'.

public object? Expr2Source { get; }

Property Value

object

Methods

ToExpression(ParameterExpression)

Build the comparison, inserting the nullable conversions the two sides need to be comparable.

public override Expression ToExpression(ParameterExpression paramExpr)

Parameters

paramExpr ParameterExpression

The query's lambda parameter.

Returns

Expression

An expression of type bool.

Validate(Type)

Resolve both operands against the entity type, coercing the right-hand side to the left's type.

public override void Validate(Type entityType)

Parameters

entityType Type

The type the query returns.

Exceptions

Exception

The left operand is null or unresolvable, or 'in' was given a right-hand operand that is not an array.