We're updating the issue view to help you get more done. 

SQL Backend: Support Expression.And and Expression.Or for logical comparisons

Description

In Visual Basic and C#, the bitwise AND and OR operators can also be used for logical comparison of boolean values. When translated to a LINQ expression tree, the respective operator becomes an expression of ExpressionType.And/ExpressionType.Or (not ExpressionType.AndAlso/OrElse). The SQL generator currently always treats ExpressionType.And/Or as a bitwise integer operators, since the operators are documented as bitwise operators. However, SQL Server can't deal with a bitwise operator where a logical operator is required.

Change this.

Implementation notes:

  • Either replace Expression.And/Or with AndAlso/OrElse somewhere, e.g., in SqlContextExpressionVisitor.

  • Or change BinaryExpressionTextGenerator to differentiate boolean ops from integer ops.

Status

Assignee

Fabian Schmied

Reporter

Fabian Schmied

Time tracking

3h

Components

Fix versions

Priority

Normal
Configure