Browse Source

Update exp to sql

pull/31/head
sunkaixuan 2 years ago
parent
commit
d4a4f552b6
  1. 5
      Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/BinaryExpressionResolve.cs

5
Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/BinaryExpressionResolve.cs

@ -124,6 +124,11 @@ 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))
{
base.Context.Result.Append($" {GetNewExpressionValue(leftExpression)} {(expression.NodeType==ExpressionType.AndAlso? " AND ":" OR ")} {GetNewExpressionValue(rightExpression)} ");
return;
}
if (RightIsHasValue(leftExpression, rightExpression,ExpressionTool.IsLogicOperator(expression)))
{
Expression trueValue = Expression.Constant(true);

Loading…
Cancel
Save