Ordering of boolean: Rather order by the NOT expression rather than change the ascending or descending order. NULL values are handled in the correct order now

Division: If the result of the binary is meant to be integer, use the Jet binary divide operatior '\'
pull/137/head
Christopher Jolly 3 years ago
parent aa6b5afb9f
commit 73ef68188f

@ -253,8 +253,12 @@ namespace EntityFrameworkCore.Jet.Query.Sql.Internal
if (orderingExpression.Expression.TypeMapping?.GetType() == _boolTypeMapping?.GetType())
{
orderingExpression = new OrderingExpression(
orderingExpression.Expression,
!orderingExpression.IsAscending);
new SqlUnaryExpression(
ExpressionType.Not,
orderingExpression.Expression,
orderingExpression.Expression.Type,
orderingExpression.Expression.TypeMapping),
orderingExpression.IsAscending);
}
return base.VisitOrdering(orderingExpression);
@ -388,6 +392,7 @@ namespace EntityFrameworkCore.Jet.Query.Sql.Internal
ExpressionType.And => " BAND ",
ExpressionType.Modulo => " MOD ",
ExpressionType.Or => " BOR ",
ExpressionType.Divide when binaryExpression.Type == typeof(Int32) => " \\ ",
_ => base.GetOperator(binaryExpression),
};

Loading…
Cancel
Save