- 修复 UpdateJoin SetIf逻辑判断问题

This commit is contained in:
d4ilys 2023-10-27 21:08:02 +08:00
parent 656ae2f3bb
commit 5b0582483c

View File

@ -169,6 +169,7 @@ namespace FreeSql.Internal.CommonProvider
public IUpdateJoin<T1, T2> Set(Expression<Func<T1, T2, bool>> exp) => SetIf(true, exp); public IUpdateJoin<T1, T2> Set(Expression<Func<T1, T2, bool>> exp) => SetIf(true, exp);
public IUpdateJoin<T1, T2> SetIf(bool condition, Expression<Func<T1, T2, bool>> exp) public IUpdateJoin<T1, T2> SetIf(bool condition, Expression<Func<T1, T2, bool>> exp)
{ {
if (condition == false) return this;
var body = exp?.Body; var body = exp?.Body;
var nodeType = body?.NodeType; var nodeType = body?.NodeType;
if (nodeType == ExpressionType.Convert) if (nodeType == ExpressionType.Convert)