From 11d43fbc57bdbe62440427a1ca120f2f0383a703 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Tue, 10 Oct 2017 19:06:56 +0800 Subject: [PATCH] - --- .../QueryableProvider/QueryableProvider.cs | 90 +++++++++++++++++++ Src/Asp.Net/SqlSugar/Interface/IQueryable.cs | 15 ++++ 2 files changed, 105 insertions(+) diff --git a/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs index f2c773d7d..5ac436ce5 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs @@ -1418,6 +1418,30 @@ namespace SqlSugar _OrderBy(expression, type); return this; } + public new ISugarQueryable OrderByIF(bool isOrderBy, string orderFileds) + { + if (isOrderBy) + base.OrderBy(orderFileds); + return this; + } + public new ISugarQueryable OrderByIF(bool isOrderBy, Expression> expression, OrderByType type = OrderByType.Asc) + { + if (isOrderBy) + _OrderBy(expression, type); + return this; + } + public ISugarQueryable OrderByIF(bool isOrderBy, Expression> expression, OrderByType type = OrderByType.Asc) + { + if (isOrderBy) + _OrderBy(expression, type); + return this; + } + public ISugarQueryable OrderByIF(bool isOrderBy, Expression> expression, OrderByType type = OrderByType.Asc) + { + if (isOrderBy) + _OrderBy(expression, type); + return this; + } #endregion #region Select @@ -1716,6 +1740,36 @@ namespace SqlSugar _OrderBy(expression, type); return this; } + public new ISugarQueryable OrderByIF(bool isOrderBy, string orderFileds) + { + if (isOrderBy) + base.OrderBy(orderFileds); + return this; + } + public new ISugarQueryable OrderByIF(bool isOrderBy, Expression> expression, OrderByType type = OrderByType.Asc) + { + if (isOrderBy) + _OrderBy(expression, type); + return this; + } + public ISugarQueryable OrderByIF(bool isOrderBy, Expression> expression, OrderByType type = OrderByType.Asc) + { + if (isOrderBy) + _OrderBy(expression, type); + return this; + } + public ISugarQueryable OrderByIF(bool isOrderBy, Expression> expression, OrderByType type = OrderByType.Asc) + { + if (isOrderBy) + _OrderBy(expression, type); + return this; + } + public ISugarQueryable OrderByIF(bool isOrderBy, Expression> expression, OrderByType type = OrderByType.Asc) + { + if (isOrderBy) + _OrderBy(expression, type); + return this; + } #endregion #region GroupBy @@ -1987,6 +2041,42 @@ namespace SqlSugar _OrderBy(expression, type); return this; } + public new ISugarQueryable OrderByIF(bool isOrderBy, string orderFileds) + { + if (isOrderBy) + base.OrderBy(orderFileds); + return this; + } + public new ISugarQueryable OrderByIF(bool isOrderBy, Expression> expression, OrderByType type = OrderByType.Asc) + { + if (isOrderBy) + _OrderBy(expression, type); + return this; + } + public ISugarQueryable OrderByIF(bool isOrderBy, Expression> expression, OrderByType type = OrderByType.Asc) + { + if (isOrderBy) + _OrderBy(expression, type); + return this; + } + public ISugarQueryable OrderByIF(bool isOrderBy, Expression> expression, OrderByType type = OrderByType.Asc) + { + if (isOrderBy) + _OrderBy(expression, type); + return this; + } + public ISugarQueryable OrderByIF(bool isOrderBy, Expression> expression, OrderByType type = OrderByType.Asc) + { + if (isOrderBy) + _OrderBy(expression, type); + return this; + } + public ISugarQueryable OrderByIF(bool isOrderBy, Expression> expression, OrderByType type = OrderByType.Asc) + { + if (isOrderBy) + _OrderBy(expression, type); + return this; + } #endregion #region GroupBy diff --git a/Src/Asp.Net/SqlSugar/Interface/IQueryable.cs b/Src/Asp.Net/SqlSugar/Interface/IQueryable.cs index 32f521277..e30ff8e00 100644 --- a/Src/Asp.Net/SqlSugar/Interface/IQueryable.cs +++ b/Src/Asp.Net/SqlSugar/Interface/IQueryable.cs @@ -210,6 +210,10 @@ namespace SqlSugar new ISugarQueryable OrderBy(Expression> expression, OrderByType type = OrderByType.Asc); ISugarQueryable OrderBy(Expression> expression, OrderByType type = OrderByType.Asc); ISugarQueryable OrderBy(Expression> expression, OrderByType type = OrderByType.Asc); + new ISugarQueryable OrderByIF(bool isOrderBy, string orderFileds); + new ISugarQueryable OrderByIF(bool isOrderBy, Expression> expression, OrderByType type = OrderByType.Asc); + ISugarQueryable OrderByIF(bool isOrderBy, Expression> expression, OrderByType type = OrderByType.Asc); + ISugarQueryable OrderByIF(bool isOrderBy, Expression> expression, OrderByType type = OrderByType.Asc); #endregion #region GroupBy @@ -273,6 +277,11 @@ namespace SqlSugar ISugarQueryable OrderBy(Expression> expression, OrderByType type = OrderByType.Asc); ISugarQueryable OrderBy(Expression> expression, OrderByType type = OrderByType.Asc); ISugarQueryable OrderBy(Expression> expression, OrderByType type = OrderByType.Asc); + new ISugarQueryable OrderByIF(bool isOrderBy, string orderFileds); + new ISugarQueryable OrderByIF(bool isOrderBy, Expression> expression, OrderByType type = OrderByType.Asc); + ISugarQueryable OrderByIF(bool isOrderBy, Expression> expression, OrderByType type = OrderByType.Asc); + ISugarQueryable OrderByIF(bool isOrderBy, Expression> expression, OrderByType type = OrderByType.Asc); + ISugarQueryable OrderByIF(bool isOrderBy, Expression> expression, OrderByType type = OrderByType.Asc); #endregion #region GroupBy @@ -342,6 +351,12 @@ namespace SqlSugar ISugarQueryable OrderBy(Expression> expression, OrderByType type = OrderByType.Asc); ISugarQueryable OrderBy(Expression> expression, OrderByType type = OrderByType.Asc); ISugarQueryable OrderBy(Expression> expression, OrderByType type = OrderByType.Asc); + new ISugarQueryable OrderByIF(bool isOrderBy, string orderFileds); + new ISugarQueryable OrderByIF(bool isOrderBy, Expression> expression, OrderByType type = OrderByType.Asc); + ISugarQueryable OrderByIF(bool isOrderBy, Expression> expression, OrderByType type = OrderByType.Asc); + ISugarQueryable OrderByIF(bool isOrderBy, Expression> expression, OrderByType type = OrderByType.Asc); + ISugarQueryable OrderByIF(bool isOrderBy, Expression> expression, OrderByType type = OrderByType.Asc); + ISugarQueryable OrderByIF(bool isOrderBy, Expression> expression, OrderByType type = OrderByType.Asc); #endregion #region GroupBy