- 修复 复杂的表达式解析 OR 的括号 bug;

This commit is contained in:
28810
2019-05-08 16:12:33 +08:00
parent 4c1dec64d4
commit 8f1bce0574
8 changed files with 44 additions and 12 deletions

View File

@ -868,7 +868,7 @@ namespace FreeSql.Internal {
case ExpressionType.Coalesce:
return _common.IsNull(ExpressionLambdaToSql(expBinary.Left, tsc), ExpressionLambdaToSql(expBinary.Right, tsc));
case ExpressionType.OrElse:
return $"({ExpressionLambdaToSql(expBinary.Left, tsc)} OR {ExpressionLambdaToSql(expBinary.Right, tsc)})";
return $"(({ExpressionLambdaToSql(expBinary.Left, tsc)}) OR ({ExpressionLambdaToSql(expBinary.Right, tsc)}))";
}
if (dicExpressionOperator.TryGetValue(expBinary.NodeType, out var tryoper) == false) return "";