- 修复 复杂的表达式解析 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

@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>0.5.9</Version>
<Version>0.5.10</Version>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>YeXiangQin</Authors>
<Description>FreeSql is the most convenient ORM in dotnet. It supports Mysql, Postgresql, SqlServer, Oracle and Sqlite.</Description>

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 "";