mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 18:52:50 +08:00
- 增加 HavingIf 方法;#1095
This commit is contained in:
parent
41432cde0a
commit
ae1b053189
@ -19,11 +19,18 @@ namespace FreeSql
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 按聚合条件过滤,Where(a => a.Count() > 10)
|
/// 按聚合条件过滤,Having(a => a.Count() > 10)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="exp">lambda表达式</param>
|
/// <param name="exp">lambda表达式</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
ISelectGrouping<TKey, TValue> Having(Expression<Func<ISelectGroupingAggregate<TKey, TValue>, bool>> exp);
|
ISelectGrouping<TKey, TValue> Having(Expression<Func<ISelectGroupingAggregate<TKey, TValue>, bool>> exp);
|
||||||
|
/// <summary>
|
||||||
|
/// 按聚合条件过滤,HavingIf(true, a => a.Count() > 10)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="condition">true 时生效</param>
|
||||||
|
/// <param name="exp">lambda表达式</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
ISelectGrouping<TKey, TValue> HavingIf(bool condition, Expression<Func<ISelectGroupingAggregate<TKey, TValue>, bool>> exp);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 按列排序,OrderBy(a => a.Time)
|
/// 按列排序,OrderBy(a => a.Time)
|
||||||
|
@ -226,6 +226,7 @@ namespace FreeSql.Internal.CommonProvider
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ISelectGrouping<TKey, TValue> HavingIf(bool condition, Expression<Func<ISelectGroupingAggregate<TKey, TValue>, bool>> exp) => condition ? Having(exp) : this;
|
||||||
public ISelectGrouping<TKey, TValue> Having(Expression<Func<ISelectGroupingAggregate<TKey, TValue>, bool>> exp)
|
public ISelectGrouping<TKey, TValue> Having(Expression<Func<ISelectGroupingAggregate<TKey, TValue>, bool>> exp)
|
||||||
{
|
{
|
||||||
_lambdaParameter = exp?.Parameters[0];
|
_lambdaParameter = exp?.Parameters[0];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user