Update Core

This commit is contained in:
sunkaixuan
2017-06-28 12:46:14 +08:00
parent 4085c42e66
commit 2a55cb5239
2 changed files with 295 additions and 5 deletions

View File

@@ -224,7 +224,8 @@ namespace SqlSugar
var fieldName = lamResult.GetResultString();
return In(fieldName, inValues);
}
public virtual ISugarQueryable<T> In<TParamter>(List<TParamter> pkValues) {
public virtual ISugarQueryable<T> In<TParamter>(List<TParamter> pkValues)
{
if (pkValues == null || pkValues.Count == 0)
{
Where(SqlBuilder.SqlFalse);
@@ -232,7 +233,8 @@ namespace SqlSugar
}
return In(pkValues.ToArray());
}
public virtual ISugarQueryable<T> In<FieldType>(string InFieldName, List<FieldType> inValues) {
public virtual ISugarQueryable<T> In<FieldType>(string InFieldName, List<FieldType> inValues)
{
if (inValues == null || inValues.Count == 0)
{
Where(SqlBuilder.SqlFalse);
@@ -240,7 +242,8 @@ namespace SqlSugar
}
return In(InFieldName, inValues.ToArray());
}
public virtual ISugarQueryable<T> In<FieldType>(Expression<Func<T, object>> expression, List<FieldType> inValues) {
public virtual ISugarQueryable<T> In<FieldType>(Expression<Func<T, object>> expression, List<FieldType> inValues)
{
if (inValues == null || inValues.Count == 0)
{
Where(SqlBuilder.SqlFalse);
@@ -663,6 +666,18 @@ namespace SqlSugar
_Where(expression);
return this;
}
public ISugarQueryable<T, T2> WhereIf(bool isWhere, Expression<Func<T, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
public ISugarQueryable<T, T2> WhereIf(bool isWhere, Expression<Func<T, T2, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
#endregion
#region Select
@@ -774,6 +789,26 @@ namespace SqlSugar
return this;
}
public ISugarQueryable<T, T2, T3> WhereIf(bool isWhere, Expression<Func<T, T2, T3, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
public ISugarQueryable<T, T2, T3> WhereIf(bool isWhere, Expression<Func<T, T2, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
public ISugarQueryable<T, T2, T3> WhereIf(bool isWhere, Expression<Func<T, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
#endregion
}
@@ -802,6 +837,34 @@ namespace SqlSugar
_Where(expression);
return this;
}
public ISugarQueryable<T, T2, T3, T4> WhereIf(bool isWhere, Expression<Func<T, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
public ISugarQueryable<T, T2, T3, T4> WhereIf(bool isWhere, Expression<Func<T, T2, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
public ISugarQueryable<T, T2, T3, T4> WhereIf(bool isWhere, Expression<Func<T, T2, T3, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
public ISugarQueryable<T, T2, T3, T4> WhereIf(bool isWhere, Expression<Func<T, T2, T3, T4, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
#endregion
#region Select
@@ -895,6 +958,41 @@ namespace SqlSugar
_Where(expression);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5> WhereIf(bool isWhere, Expression<Func<T, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5> WhereIf(bool isWhere, Expression<Func<T, T2, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5> WhereIf(bool isWhere, Expression<Func<T, T2, T3, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5> WhereIf(bool isWhere, Expression<Func<T, T2, T3, T4, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5> WhereIf(bool isWhere, Expression<Func<T, T2, T3, T4, T5, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
#endregion
#region Select
@@ -1007,6 +1105,48 @@ namespace SqlSugar
_Where(expression);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6> WhereIf(bool isWhere, Expression<Func<T, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6> WhereIf(bool isWhere, Expression<Func<T, T2, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6> WhereIf(bool isWhere, Expression<Func<T, T2, T3, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6> WhereIf(bool isWhere, Expression<Func<T, T2, T3, T4, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6> WhereIf(bool isWhere, Expression<Func<T, T2, T3, T4, T5, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6> WhereIf(bool isWhere, Expression<Func<T, T2, T3, T4, T5, T6, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
#endregion
#region Select
@@ -1138,6 +1278,55 @@ namespace SqlSugar
_Where(expression);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6, T7> WhereIf(bool isWhere, Expression<Func<T, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6, T7> WhereIf(bool isWhere, Expression<Func<T, T2, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6, T7> WhereIf(bool isWhere, Expression<Func<T, T2, T3, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6, T7> WhereIf(bool isWhere, Expression<Func<T, T2, T3, T4, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6, T7> WhereIf(bool isWhere, Expression<Func<T, T2, T3, T4, T5, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6, T7> WhereIf(bool isWhere, Expression<Func<T, T2, T3, T4, T5, T6, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6, T7> WhereIf(bool isWhere, Expression<Func<T, T2, T3, T4, T5, T6, T7, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
#endregion
#region Select
@@ -1241,6 +1430,7 @@ namespace SqlSugar
_GroupBy(expression);
return this;
}
#endregion
}
#endregion
@@ -1288,6 +1478,62 @@ namespace SqlSugar
_Where(expression);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8> WhereIf(bool isWhere, Expression<Func<T, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8> WhereIf(bool isWhere, Expression<Func<T, T2, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8> WhereIf(bool isWhere, Expression<Func<T, T2, T3, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8> WhereIf(bool isWhere, Expression<Func<T, T2, T3, T4, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8> WhereIf(bool isWhere, Expression<Func<T, T2, T3, T4, T5, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8> WhereIf(bool isWhere, Expression<Func<T, T2, T3, T4, T5, T6, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8> WhereIf(bool isWhere, Expression<Func<T, T2, T3, T4, T5, T6, T7, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
public ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8> WhereIf(bool isWhere, Expression<Func<T, T2, T3, T4, T5, T6, T7, T8, bool>> expression)
{
if (isWhere)
_Where(expression);
return this;
}
#endregion
#region Select
@@ -1405,6 +1651,7 @@ namespace SqlSugar
_GroupBy(expression);
return this;
}
#endregion
}
#endregion

View File

@@ -15,7 +15,7 @@ namespace SqlSugar
ISugarQueryable<T> AS<T2>(string tableName);
ISugarQueryable<T> AS(string tableName);
ISugarQueryable<T> With(string withString);
ISugarQueryable<T> Filter(string FilterName, bool isDisabledGobalFilter= false);
ISugarQueryable<T> Filter(string FilterName, bool isDisabledGobalFilter = false);
ISugarQueryable<T> AddParameters(object pars);
ISugarQueryable<T> AddParameters(SugarParameter[] pars);
ISugarQueryable<T> AddJoinInfo(string tableName, string shortName, string joinWhere, JoinType type = JoinType.Left);
@@ -57,7 +57,7 @@ namespace SqlSugar
bool Any(Expression<Func<T, bool>> expression);
bool Any();
ISugarQueryable<TResult> Select<TResult>(Expression<Func<T, TResult>> expression);
ISugarQueryable<TResult> Select<TResult>(string select) where TResult : class, new();
ISugarQueryable<T> Select(string select);
@@ -96,6 +96,9 @@ namespace SqlSugar
#region Where
new ISugarQueryable<T, T2> Where(Expression<Func<T, bool>> expression);
ISugarQueryable<T, T2> Where(Expression<Func<T, T2, bool>> expression);
ISugarQueryable<T, T2> WhereIf(bool isWhere, Expression<Func<T, bool>> expression);
ISugarQueryable<T, T2> WhereIf(bool isWhere, Expression<Func<T, T2, bool>> expression);
#endregion
#region Select
@@ -118,6 +121,10 @@ namespace SqlSugar
new ISugarQueryable<T, T2, T3> Where(Expression<Func<T, bool>> expression);
ISugarQueryable<T, T2, T3> Where(Expression<Func<T, T2, bool>> expression);
ISugarQueryable<T, T2, T3> Where(Expression<Func<T, T2, T3, bool>> expression);
ISugarQueryable<T, T2, T3> WhereIf(bool isWhere, Expression<Func<T, bool>> expression);
ISugarQueryable<T, T2, T3> WhereIf(bool isWhere, Expression<Func<T, T2, bool>> expression);
ISugarQueryable<T, T2, T3> WhereIf(bool isWhere, Expression<Func<T, T2, T3, bool>> expression);
#endregion
#region Select
@@ -144,6 +151,11 @@ namespace SqlSugar
ISugarQueryable<T, T2, T3, T4> Where(Expression<Func<T, T2, bool>> expression);
ISugarQueryable<T, T2, T3, T4> Where(Expression<Func<T, T2, T3, bool>> expression);
ISugarQueryable<T, T2, T3, T4> Where(Expression<Func<T, T2, T3, T4, bool>> expression);
new ISugarQueryable<T, T2, T3, T4> WhereIf(bool isWhere, Expression<Func<T, bool>> expression);
ISugarQueryable<T, T2, T3, T4> WhereIf(bool isWhere, Expression<Func<T, T2, bool>> expression);
ISugarQueryable<T, T2, T3, T4> WhereIf(bool isWhere, Expression<Func<T, T2, T3, bool>> expression);
ISugarQueryable<T, T2, T3, T4> WhereIf(bool isWhere, Expression<Func<T, T2, T3, T4, bool>> expression);
#endregion
#region Select
@@ -174,6 +186,13 @@ namespace SqlSugar
ISugarQueryable<T, T2, T3, T4, T5> Where(Expression<Func<T, T2, T3, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5> Where(Expression<Func<T, T2, T3, T4, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5> Where(Expression<Func<T, T2, T3, T4, T5, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5> WhereIf(bool isWhere, Expression<Func<T, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5> WhereIf(bool isWhere, Expression<Func<T, T2, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5> WhereIf(bool isWhere, Expression<Func<T, T2, T3, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5> WhereIf(bool isWhere, Expression<Func<T, T2, T3, T4, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5> WhereIf(bool isWhere, Expression<Func<T, T2, T3, T4, T5, bool>> expression);
#endregion
#region Select
@@ -208,6 +227,13 @@ namespace SqlSugar
ISugarQueryable<T, T2, T3, T4, T5, T6> Where(Expression<Func<T, T2, T3, T4, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5, T6> Where(Expression<Func<T, T2, T3, T4, T5, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5, T6> Where(Expression<Func<T, T2, T3, T4, T5, T6, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5, T6> WhereIf(bool isWhere, Expression<Func<T, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5, T6> WhereIf(bool isWhere, Expression<Func<T, T2, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5, T6> WhereIf(bool isWhere, Expression<Func<T, T2, T3, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5, T6> WhereIf(bool isWhere, Expression<Func<T, T2, T3, T4, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5, T6> WhereIf(bool isWhere, Expression<Func<T, T2, T3, T4, T5, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5, T6> WhereIf(bool isWhere, Expression<Func<T, T2, T3, T4, T5, T6, bool>> expression);
#endregion
#region Select
@@ -246,6 +272,14 @@ namespace SqlSugar
ISugarQueryable<T, T2, T3, T4, T5, T6, T7> Where(Expression<Func<T, T2, T3, T4, T5, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5, T6, T7> Where(Expression<Func<T, T2, T3, T4, T5, T6, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5, T6, T7> Where(Expression<Func<T, T2, T3, T4, T5, T6, T7, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5, T6, T7> WhereIf(bool isWhere, Expression<Func<T, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5, T6, T7> WhereIf(bool isWhere, Expression<Func<T, T2, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5, T6, T7> WhereIf(bool isWhere, Expression<Func<T, T2, T3, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5, T6, T7> WhereIf(bool isWhere, Expression<Func<T, T2, T3, T4, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5, T6, T7> WhereIf(bool isWhere, Expression<Func<T, T2, T3, T4, T5, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5, T6, T7> WhereIf(bool isWhere, Expression<Func<T, T2, T3, T4, T5, T6, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5, T6, T7> WhereIf(bool isWhere, Expression<Func<T, T2, T3, T4, T5, T6, T7, bool>> expression);
#endregion
#region Select
@@ -288,6 +322,15 @@ namespace SqlSugar
ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8> Where(Expression<Func<T, T2, T3, T4, T5, T6, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8> Where(Expression<Func<T, T2, T3, T4, T5, T6, T7, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8> Where(Expression<Func<T, T2, T3, T4, T5, T6, T7, T8, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8> WhereIf(bool isWhere, Expression<Func<T, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8> WhereIf(bool isWhere, Expression<Func<T, T2, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8> WhereIf(bool isWhere, Expression<Func<T, T2, T3, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8> WhereIf(bool isWhere, Expression<Func<T, T2, T3, T4, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8> WhereIf(bool isWhere, Expression<Func<T, T2, T3, T4, T5, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8> WhereIf(bool isWhere, Expression<Func<T, T2, T3, T4, T5, T6, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8> WhereIf(bool isWhere, Expression<Func<T, T2, T3, T4, T5, T6, T7, bool>> expression);
ISugarQueryable<T, T2, T3, T4, T5, T6, T7, T8> WhereIf(bool isWhere, Expression<Func<T, T2, T3, T4, T5, T6, T7, T8, bool>> expression);
#endregion
#region Select