修复 ISelect2 以上 WhereIf 条件作用反了 bug

This commit is contained in:
28810
2019-04-18 13:54:11 +08:00
parent 8d266a556e
commit acc1754e2e
12 changed files with 43 additions and 29 deletions

View File

@ -145,10 +145,9 @@ namespace FreeSql.Internal.CommonProvider {
}
ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9> ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.WhereIf(bool condition, Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, bool>> exp) {
if (condition) return this.Where(null);
if (exp == null) return this.Where(null);
if (condition == false || exp == null) return this;
for (var a = 0; a < exp.Parameters.Count; a++) _tables[a].Parameter = exp.Parameters[a];
return condition ? this.Where(_commonExpression.ExpressionWhereLambda(_tables, exp?.Body, null)) : this;
return this.Where(_commonExpression.ExpressionWhereLambda(_tables, exp?.Body, null));
}
bool ISelect<T1, T2, T3, T4, T5, T6, T7, T8, T9>.Any(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, bool>> exp) {