Browse Source

新增GroupByIF的重载方法

pull/40/head
orches 1 year ago
parent
commit
5cd5751239
  1. 12
      Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs
  2. 2
      Src/Asp.NetCore2/SqlSugar/Interface/IQueryable.cs

12
Src/Asp.NetCore2/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs

@ -1078,6 +1078,18 @@ namespace SqlSugar
}
return this;
}
public ISugarQueryable<T> GroupByIF(bool isGroupBy, string groupFields)
{
if (isGroupBy)
{
GroupBy(groupFields);
}
return this;
}
public virtual ISugarQueryable<T> OrderByIF(bool isOrderBy, string orderFileds)
{
if (isOrderBy)

2
Src/Asp.NetCore2/SqlSugar/Interface/IQueryable.cs

@ -117,6 +117,8 @@ namespace SqlSugar
ISugarQueryable<T> GroupBy(string groupFileds);
ISugarQueryable<T> GroupByIF(bool isGroupBy, Expression<Func<T, object>> expression);
ISugarQueryable<T> GroupByIF(bool isGroupBy, string groupFields);
ISugarQueryable<T> PartitionBy(Expression<Func<T, object>> expression);
ISugarQueryable<T> PartitionBy(string groupFileds);

Loading…
Cancel
Save