mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-15 18:55:07 +08:00
Add OrderByIF
This commit is contained in:
@@ -277,6 +277,21 @@ namespace SqlSugar
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual ISugarQueryable<T> OrderByIF(bool isOrderBy, string orderFileds)
|
||||
{
|
||||
if (isOrderBy)
|
||||
return this.OrderBy(orderFileds);
|
||||
else
|
||||
return this;
|
||||
}
|
||||
public virtual ISugarQueryable<T> OrderByIF(bool isOrderBy, Expression<Func<T, object>> expression, OrderByType type = OrderByType.Asc)
|
||||
{
|
||||
if (isOrderBy)
|
||||
return this.OrderBy(expression, type);
|
||||
else
|
||||
return this;
|
||||
}
|
||||
|
||||
public virtual ISugarQueryable<T> GroupBy(string groupFileds)
|
||||
{
|
||||
var croupByValue = QueryBuilder.GroupByValue;
|
||||
@@ -1134,6 +1149,11 @@ namespace SqlSugar
|
||||
#endregion
|
||||
|
||||
#region Order
|
||||
public new ISugarQueryable<T, T2> OrderBy(string orderFileds)
|
||||
{
|
||||
base.OrderBy(orderFileds);
|
||||
return this;
|
||||
}
|
||||
public ISugarQueryable<T, T2> OrderBy(Expression<Func<T, T2, object>> expression, OrderByType type = OrderByType.Asc)
|
||||
{
|
||||
_OrderBy(expression, type);
|
||||
@@ -1145,6 +1165,24 @@ namespace SqlSugar
|
||||
_OrderBy(expression, type);
|
||||
return this;
|
||||
}
|
||||
public new ISugarQueryable<T, T2> OrderByIF(bool isOrderBy, string orderFileds)
|
||||
{
|
||||
if (isOrderBy)
|
||||
base.OrderBy(orderFileds);
|
||||
return this;
|
||||
}
|
||||
public new ISugarQueryable<T, T2> OrderByIF(bool isOrderBy, Expression<Func<T, object>> expression, OrderByType type = OrderByType.Asc)
|
||||
{
|
||||
if (isOrderBy)
|
||||
_OrderBy(expression,type);
|
||||
return this;
|
||||
}
|
||||
public ISugarQueryable<T, T2> OrderByIF(bool isOrderBy, Expression<Func<T, T2, object>> expression, OrderByType type = OrderByType.Asc)
|
||||
{
|
||||
if (isOrderBy)
|
||||
_OrderBy(expression, type);
|
||||
return this;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region GroupBy
|
||||
|
@@ -44,6 +44,10 @@ namespace SqlSugar
|
||||
|
||||
ISugarQueryable<T> OrderBy(string orderFileds);
|
||||
ISugarQueryable<T> OrderBy(Expression<Func<T, object>> expression, OrderByType type = OrderByType.Asc);
|
||||
ISugarQueryable<T> OrderByIF(bool isOrderBy,string orderFileds);
|
||||
ISugarQueryable<T> OrderByIF(bool isOrderBy, Expression<Func<T, object>> expression, OrderByType type = OrderByType.Asc);
|
||||
|
||||
|
||||
ISugarQueryable<T> GroupBy(Expression<Func<T, object>> expression);
|
||||
ISugarQueryable<T> GroupBy(string groupFileds);
|
||||
|
||||
@@ -137,8 +141,12 @@ namespace SqlSugar
|
||||
#endregion
|
||||
|
||||
#region OrderBy
|
||||
new ISugarQueryable<T,T2> OrderBy(string orderFileds);
|
||||
new ISugarQueryable<T, T2> OrderBy(Expression<Func<T, object>> expression, OrderByType type = OrderByType.Asc);
|
||||
ISugarQueryable<T, T2> OrderBy(Expression<Func<T, T2, object>> expression, OrderByType type = OrderByType.Asc);
|
||||
new ISugarQueryable<T,T2> OrderByIF(bool isOrderBy, string orderFileds);
|
||||
new ISugarQueryable<T, T2> OrderByIF(bool isOrderBy, Expression<Func<T, object>> expression, OrderByType type = OrderByType.Asc);
|
||||
ISugarQueryable<T,T2> OrderByIF(bool isOrderBy, Expression<Func<T,T2, object>> expression, OrderByType type = OrderByType.Asc);
|
||||
#endregion
|
||||
|
||||
#region GroupBy
|
||||
|
Reference in New Issue
Block a user