Browse Source

Synchronization code

pull/31/head
sunkaixuan 2 years ago
parent
commit
414efd45ad
  1. 8
      Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/ResolveItems/BinaryExpressionResolve.cs

8
Src/Asp.NetCore2/SqlSugar/ExpressionsToSql/ResolveItems/BinaryExpressionResolve.cs

@ -124,6 +124,14 @@ namespace SqlSugar
base.ExactExpression = expression;
var leftExpression = expression.Left;
var rightExpression = expression.Right;
if (rightExpression is BinaryExpression
&& leftExpression is BinaryExpression
&& expression.NodeType.IsIn(ExpressionType.AndAlso, ExpressionType.OrElse)
&& this.Context.ResolveType.IsIn(ResolveExpressType.WhereSingle, ResolveExpressType.WhereMultiple))
{
base.Context.Result.Append($" {GetNewExpressionValue(leftExpression, this.Context.ResolveType)} {(expression.NodeType == ExpressionType.AndAlso ? " AND " : " OR ")} {GetNewExpressionValue(rightExpression, this.Context.ResolveType)} ");
return;
}
if (RightIsHasValue(leftExpression, rightExpression,ExpressionTool.IsLogicOperator(expression)))
{
Expression trueValue = Expression.Constant(true);

Loading…
Cancel
Save