update core

This commit is contained in:
sunkaixuna
2021-12-25 22:26:57 +08:00
parent 08df5d42f5
commit d227f58520
18 changed files with 519 additions and 32 deletions

View File

@@ -77,6 +77,11 @@ namespace SqlSugar
{
CheckConnection();
}
public virtual void OpenAlways()
{
this.Context.CurrentConnectionConfig.IsAutoCloseConnection = false;
this.Open();
}
public virtual void Close()
{
if (this.Transaction != null)

View File

@@ -1923,7 +1923,14 @@ namespace SqlSugar
}
protected ISugarQueryable<T> _As(string tableName, string entityName)
{
this.QueryBuilder.AsTables.Add(entityName, tableName);
if (this.QueryBuilder.AsTables != null && this.QueryBuilder.AsTables.Any(it => it.Key == entityName))
{
Check.Exception(true, ErrorMessage.GetThrowMessage($"use As<{tableName}>(\"{tableName}\")", $"请把 As(\"{tableName}\"), 改成 As<{tableName}实体>(\"{tableName}\")"));
}
else
{
this.QueryBuilder.AsTables.Add(entityName, tableName);
}
return this;
}
protected void _Filter(string FilterName, bool isDisabledGobalFilter)

View File

@@ -123,11 +123,17 @@ namespace SqlSugar
List<SugarParameter> parameters = new List<SugarParameter>();
var sqlBuilder = InstanceFactory.GetSqlbuilder(this.Context.CurrentConnectionConfig);
var mainIndex = 0;
var indexTree = 0;
foreach (var model in models)
{
if (model is ConditionalModel)
{
var item = model as ConditionalModel;
if (item.FieldName == $"[value=sql{UtilConstants.ReplaceKey}]")
{
builder.Append(item.FieldValue);
continue;
}
var index = mainIndex + beginIndex;
var type = index == 0 ? "" : "AND";
if (beginIndex > 0)
@@ -252,7 +258,7 @@ namespace SqlSugar
}
item.FieldName = oldName;
}
else
else if (model is ConditionalCollections)
{
var item = model as ConditionalCollections;
if (item != null && item.ConditionalList.HasValue())
@@ -274,7 +280,7 @@ namespace SqlSugar
List<IConditionalModel> conModels = new List<IConditionalModel>();
conModels.Add(con.Value);
var childSqlInfo = ConditionalModelToSql(conModels, 1000 * (1 + index) + models.IndexOf(item));
if (!isFirst)
if (!isFirst && con.Value.FieldName != $"[value=sql{UtilConstants.ReplaceKey}]")
{
builder.AppendFormat(" {0} ", con.Key.ToString().ToUpper());
@@ -292,11 +298,63 @@ namespace SqlSugar
}
}
}
else
{
var item = model as ConditionalTree;
BuilderTree(builder,item,ref indexTree, parameters, ref mainIndex);
}
mainIndex++;
}
return new KeyValuePair<string, SugarParameter[]>(builder.ToString(), parameters.ToArray());
}
private void BuilderTree(StringBuilder builder,ConditionalTree item,ref int indexTree, List<SugarParameter> parameters,ref int mainIndex)
{
var conditionals = ToConditionalCollections(item,ref indexTree, parameters);
var sqlobj = ConditionalModelToSql(new List<IConditionalModel> { conditionals }, mainIndex);
var sql = sqlobj.Key;
RepairReplicationParameters(ref sql, sqlobj.Value,indexTree);
parameters.AddRange(sqlobj.Value);
var buiderSql = sql;
builder.Append(buiderSql);
indexTree++;
}
private ConditionalCollections ToConditionalCollections(ConditionalTree item,ref int indexTree, List<SugarParameter> parameters)
{
List<KeyValuePair<WhereType, ConditionalModel>> list = new List<KeyValuePair<WhereType, ConditionalModel>>();
var index = 0;
foreach (var it in item.ConditionalList)
{
ConditionalModel model = new ConditionalModel();
if (it.Value is ConditionalModel)
{
model = (ConditionalModel)it.Value;
}
else
{
var con = ToConditionalCollections(it.Value as ConditionalTree,ref indexTree, parameters);
var sqlobj = ConditionalModelToSql(new List<IConditionalModel> { con }, index);
var sql = sqlobj.Key;
RepairReplicationParameters(ref sql, sqlobj.Value, indexTree);
model = new ConditionalModel()
{
FieldName = $"[value=sql{UtilConstants.ReplaceKey}]",
FieldValue = sql
};
parameters.AddRange(sqlobj.Value);
indexTree++;
}
list.Add(new KeyValuePair<WhereType, ConditionalModel>(it.Key, model));
index++;
}
var result= new ConditionalCollections()
{
ConditionalList = list
};
return result;
}
private static object GetFieldValue(ConditionalModel item)
{
if (item.FieldValueConvertFunc != null)

View File

@@ -12,7 +12,10 @@ namespace SqlSugar
{
public List<KeyValuePair<WhereType, ConditionalModel>> ConditionalList { get; set; }
}
public class ConditionalTree : IConditionalModel
{
public List<KeyValuePair<WhereType, IConditionalModel>> ConditionalList { get; set; }
}
public class ConditionalModel: IConditionalModel
{
public ConditionalModel()
@@ -22,8 +25,7 @@ namespace SqlSugar
public string FieldName { get; set; }
public string FieldValue { get; set; }
public ConditionalType ConditionalType { get; set; }
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
[Newtonsoft.Json.JsonIgnoreAttribute]
public Func<string,object> FieldValueConvertFunc { get; set; }
}
}

View File

@@ -55,6 +55,15 @@ namespace SqlSugar
else
{
var sql = SubTools.GetMethodValue(this.context, methodExp.Arguments[0], this.context.IsSingle ? ResolveExpressType.WhereSingle : ResolveExpressType.WhereMultiple);
if (methodExp.Method.Name == "IF")
{
var parameter = this.context.Parameters.FirstOrDefault(it => it.ParameterName == sql.Trim());
if (parameter!=null&&parameter.Value is bool)
{
sql = Convert.ToBoolean(parameter.Value) ? " 1=1 " : " 1=2 ";
this.context.Parameters.Remove(parameter);
}
}
sqls.Add(new KeyValuePair<string, string>(methodExp.Method.Name, sql));
}
}

View File

@@ -39,6 +39,7 @@ namespace SqlSugar
public int Index { get; set; }
public int ParameterIndex { get; set; }
public string SingleTableNameSubqueryShortName{ get; set; }
public string CurrentShortName { get; set; }
public MappingColumnList MappingColumns { get; set; }
public MappingTableList MappingTables { get; set; }
public IgnoreColumnList IgnoreComumnList { get; set; }

View File

@@ -645,7 +645,7 @@ namespace SqlSugar
protected bool IsSubMethod(MethodCallExpression express)
{
return SubTools.SubItemsConst.Any(it => express.Object != null && express.Object.Type.Name == "Subqueryable`1");
return SubTools.SubItemsConst.Any(it => express.Object != null && express.Object.Type.Name.StartsWith("Subqueryable`"));
}
protected static Dictionary<string, string> MethodMapping = new Dictionary<string, string>() {
{ "ToString","ToString"},

View File

@@ -422,11 +422,13 @@ namespace SqlSugar
var isBinaryExpression = item is BinaryExpression || item is MethodCallExpression;
var isConst = item is ConstantExpression;
var isIIF = name == "IIF";
var isSubIIF= (isIIF && item.ToString().StartsWith("IIF")) ;
var isIFFBoolMember = isIIF && (item is MemberExpression) && (item as MemberExpression).Type == UtilConstants.BoolType;
var isIFFUnary = isIIF && (item is UnaryExpression) && (item as UnaryExpression).Operand.Type == UtilConstants.BoolType;
var isIFFBoolBinary = isIIF && (item is BinaryExpression) && (item as BinaryExpression).Type == UtilConstants.BoolType;
var isIFFBoolMethod = isIIF && (item is MethodCallExpression) && (item as MethodCallExpression).Type == UtilConstants.BoolType;
var isFirst = item == args.First();
var isBoolValue = item.Type == UtilConstants.BoolType && item.ToString().StartsWith("value(");
if (isFirst && isIIF && isConst)
{
var value = (item as ConstantExpression).Value.ObjToBool() ? this.Context.DbMehtods.True() : this.Context.DbMehtods.False();
@@ -460,6 +462,26 @@ namespace SqlSugar
{
model.Args.Add(GetMethodCallArgs(parameter, item));
}
else if (isSubIIF)
{
model.Args.Add(GetMethodCallArgs(parameter, item));
}
else if (isBoolValue&&!isIIF&& item is MemberExpression)
{
model.Args.Add(GetMethodCallArgs(parameter, (item as MemberExpression).Expression));
}
else if (isBoolValue && isIIF && item is MemberExpression)
{
var argItem = GetMethodCallArgs(parameter, (item as MemberExpression).Expression);
if (argItem.IsMember)
{
var pName = this.Context.SqlParameterKeyWord + "true_0";
if(!this.Context.Parameters.Any(it=>it.ParameterName== pName))
this.Context.Parameters.Add(new SugarParameter(pName, true));
argItem.MemberName = $" {argItem.MemberName}={pName} ";
}
model.Args.Add(argItem);
}
else
{
AppendModel(parameter, model, item);
@@ -726,11 +748,11 @@ namespace SqlSugar
case "ToTime":
return this.Context.DbMehtods.ToTime(model);
case "ToString":
if (model.Args.Count > 1 && model.Args.Last().MemberValue.ObjToString().IsContainsIn("-", "/", ":", "yy", "ms", "hh"))
if (model.Args.Count > 1)
{
return GeDateFormat(model.Args.Last().MemberValue.ObjToString(), model.Args.First().MemberName.ObjToString());
}
Check.Exception(model.Args.Count > 1, "ToString (Format) is not supported, Use ToString().If time formatting can be used it.Date.Year+\"-\"+it.Data.Month+\"-\"+it.Date.Day ");
//Check.Exception(model.Args.Count > 1, "ToString (Format) is not supported, Use ToString().If time formatting can be used it.Date.Year+\"-\"+it.Data.Month+\"-\"+it.Date.Day ");
return this.Context.DbMehtods.ToString(model);
case "ToVarchar":
return this.Context.DbMehtods.ToVarchar(model);
@@ -826,7 +848,7 @@ namespace SqlSugar
private bool IsSubMethod(MethodCallExpression express, string methodName)
{
return SubTools.SubItemsConst.Any(it => it.Name == methodName) && express.Object != null && express.Object.Type.Name == "Subqueryable`1";
return SubTools.SubItemsConst.Any(it => it.Name == methodName) && express.Object != null && (express.Object.Type.Name.StartsWith("Subqueryable`"));
}
private bool CheckMethod(MethodCallExpression expression)
{
@@ -914,6 +936,10 @@ namespace SqlSugar
{
return $"CONVERT(varchar(100),convert(datetime,{value}), 121)";
}
else if (IsSqlServer()&&formatString!=null&& formatString.IsInt())
{
return string.Format("CONVERT(varchar(100),convert(datetime,{0}), {1})", value, formatString);
}
var parameter = new MethodCallExpressionArgs() { IsMember = true, MemberValue = DateType.Year };
var parameter2 = new MethodCallExpressionArgs() { IsMember = true, MemberName = value };
var parameters = new MethodCallExpressionModel() { Args = new List<MethodCallExpressionArgs>() { parameter2, parameter } };

View File

@@ -44,17 +44,17 @@ namespace SqlSugar
var exp = expression as MethodCallExpression;
var argExp = exp.Arguments[0];
var name =this.Context.GetTranslationColumnName((argExp as LambdaExpression).Parameters[0].Name);
var parameter = (argExp as LambdaExpression).Parameters[1];
var parameter = (argExp as LambdaExpression).Parameters.Last();
Context.InitMappingInfo(parameter.Type);
var tableName= Context.GetTranslationTableName(parameter.Type.Name, true);
var joinString =string.Format(" {2} INNER JOIN {1} {0} ",
this.Context.GetTranslationColumnName(parameter.Name),
tableName,
this.Context.JoinIndex==1?name:"");
null);
var result = joinString+ "ON " + SubTools.GetMethodValue(Context, argExp, ResolveExpressType.WhereMultiple);
//var selfParameterName = Context.GetTranslationColumnName((argExp as LambdaExpression).Parameters.First().Name) + UtilConstants.Dot;
this.Context.JoinIndex++;
new SubSelect() { Context=this.Context}.SetShortName(exp, "+");
//result = result.Replace(selfParameterName, SubTools.GetSubReplace(this.Context));
return result;
}

View File

@@ -44,17 +44,17 @@ namespace SqlSugar
var exp = expression as MethodCallExpression;
var argExp = exp.Arguments[0];
var name =this.Context.GetTranslationColumnName((argExp as LambdaExpression).Parameters[0].Name);
var parameter = (argExp as LambdaExpression).Parameters[1];
var parameter = (argExp as LambdaExpression).Parameters.Last();
Context.InitMappingInfo(parameter.Type);
var tableName= Context.GetTranslationTableName(parameter.Type.Name, true);
var joinString =string.Format(" {2} LEFT JOIN {1} {0} ",
this.Context.GetTranslationColumnName(parameter.Name),
tableName,
this.Context.JoinIndex==1?name:"");
null);
var result = joinString+ "ON " + SubTools.GetMethodValue(Context, argExp, ResolveExpressType.WhereMultiple);
//var selfParameterName = Context.GetTranslationColumnName((argExp as LambdaExpression).Parameters.First().Name) + UtilConstants.Dot;
this.Context.JoinIndex++;
new SubSelect() { Context = this.Context }.SetShortName(exp, "+");
//result = result.Replace(selfParameterName, SubTools.GetSubReplace(this.Context));
return result;
}

View File

@@ -49,10 +49,28 @@ namespace SqlSugar
this.Context.InitMappingInfo(entityType);
this.Context.RefreshMapping();
}
if(this.Context.JoinIndex==0)
return SubTools.GetMethodValue(this.Context, exp.Arguments[0],ResolveExpressType.FieldSingle);
var result = "";
if (this.Context.JoinIndex == 0)
result = SubTools.GetMethodValue(this.Context, exp.Arguments[0], ResolveExpressType.FieldSingle);
else
return SubTools.GetMethodValue(this.Context, exp.Arguments[0], ResolveExpressType.FieldMultiple);
result = SubTools.GetMethodValue(this.Context, exp.Arguments[0], ResolveExpressType.FieldMultiple);
SetShortName(exp, result);
return result;
}
public void SetShortName(MethodCallExpression exp, string result)
{
if (exp.Arguments[0] is LambdaExpression && result.IsContainsIn("+", "-"))
{
var parameters = (exp.Arguments[0] as LambdaExpression).Parameters;
if (parameters != null && parameters.Count > 0)
{
this.Context.CurrentShortName = this.Context.SqlTranslationLeft + parameters[0] + this.Context.SqlTranslationRight;
}
}
}
}
}

View File

@@ -40,10 +40,15 @@ namespace SqlSugar
public string GetValue(Expression expression)
{
var exp = expression as MethodCallExpression;
if (Regex.Matches( expression.ToString(), "Subqueryable").Count >= 2)
{
new SubSelect() { Context = this.Context }.SetShortName(exp, "+");
}
var argExp = exp.Arguments[0];
var result = "WHERE " + SubTools.GetMethodValue(Context, argExp, ResolveExpressType.WhereMultiple);
var regex = @"^WHERE (\@Const\d+) $";
if (this.Context is OracleExpressionContext)
{

View File

@@ -57,12 +57,15 @@ namespace SqlSugar
{
var subExp = (context.Expression as BinaryExpression).Left is MethodCallExpression ? (context.Expression as BinaryExpression).Left : (context.Expression as BinaryExpression).Right;
var meExp = ((subExp as MethodCallExpression).Object as MethodCallExpression).Arguments[0] as LambdaExpression;
var selfParameterName = meExp.Parameters.First().Name;
context.SingleTableNameSubqueryShortName = (((meExp.Body as BinaryExpression).Left as MemberExpression).Expression as ParameterExpression).Name;
if (context.SingleTableNameSubqueryShortName == selfParameterName)
if (subExp is MethodCallExpression)
{
context.SingleTableNameSubqueryShortName = (((meExp.Body as BinaryExpression).Right as MemberExpression).Expression as ParameterExpression).Name;
var meExp = ((subExp as MethodCallExpression).Object as MethodCallExpression).Arguments[0] as LambdaExpression;
var selfParameterName = meExp.Parameters.First().Name;
context.SingleTableNameSubqueryShortName = (((meExp.Body as BinaryExpression).Left as MemberExpression).Expression as ParameterExpression).Name;
if (context.SingleTableNameSubqueryShortName == selfParameterName)
{
context.SingleTableNameSubqueryShortName = (((meExp.Body as BinaryExpression).Right as MemberExpression).Expression as ParameterExpression).Name;
}
}
}
else if (context.RootExpression!=null&&context.Expression.GetType().Name == "SimpleBinaryExpression")
@@ -96,10 +99,33 @@ namespace SqlSugar
{
GetSubAs(sqlItems, asItems);
}
var sql = string.Join(UtilConstants.Space, sqlItems);
if (this.context.CurrentShortName.HasValue())
{
GetShortName(sqlItems);
}
var sql = "";
if (sqlItems.Count(it => IsJoin(it)) > 1)
{
var index = sqlItems.IndexOf(sqlItems.First(x=>IsJoin(x)));
var joinitems = sqlItems.Where(it => IsJoin(it)).ToList();
joinitems.Reverse();
var items = sqlItems.Where(it => !IsJoin(it)).ToList();
items.InsertRange(index, joinitems);
sql = string.Join(UtilConstants.Space, items);
}
else
{
sql = string.Join(UtilConstants.Space, sqlItems);
}
return this.context.DbMehtods.Pack(sql);
}
private static bool IsJoin(string it)
{
return it.StartsWith(" INNER JOIN") || it.StartsWith(" LEFT JOIN");
}
private void GetSubAs(List<string> sqlItems, List<string> asItems)
{
for (int i = 0; i < sqlItems.Count; i++)
@@ -112,11 +138,27 @@ namespace SqlSugar
}
}
}
private void GetShortName(List<string> sqlItems)
{
for (int i = 0; i < sqlItems.Count; i++)
{
if (sqlItems[i].StartsWith("FROM " + this.context.SqlTranslationLeft))
{
sqlItems[i] = sqlItems[i]+" "+this.context.CurrentShortName +" ";
}
}
}
private List<string> GetSubItems()
{
var isSubSubQuery = this.allMethods.Select(it => it.ToString()).Any(it => Regex.Matches(it, "Subquery").Count > 1);
var isubList = this.allMethods.Select(exp =>
{
if (isSubSubQuery)
{
this.context.JoinIndex = 1;
this.context.SubQueryIndex = 0;
}
var methodName = exp.Method.Name;
var items = SubTools.SubItems(this.context);
var item = items.First(s => s.Name == methodName);

View File

@@ -0,0 +1,40 @@
//@{
// var count = 9;
// var T = "";
// var Tn = "";
// for (int i = 0; i < count; i++)
// {
// T += "T" + (i + 1) + ",";
// }
// Tn = T + "JoinType";
// T = T.TrimEnd(',');
//}
//public class Subqueryable<@T> : Subqueryable<T1> where T1 : class, new()
//{
// public Subqueryable<@Tn> InnerJoin<JoinType>(Func<@Tn, bool> expression)
// {
// return new Subqueryable<@Tn>();
// }
// public Subqueryable<@Tn> LeftJoin<JoinType>(Func<@Tn, bool> expression)
// {
// return new Subqueryable<@Tn>();
// }
// @for(int i = 0; i<count; i++)
// {
// var itemcount = i + 1;
// var wtn = "";
// for (int j = 0; j<itemcount; j++)
// {
// wtn += "T" + (j+1) + ",";
// }
//wtn = wtn.TrimEnd(',');
// @:public @(i == 0 ? "new" : "") Subqueryable<@T> Where(Func<@wtn, bool> expression)
// @:{
// @:return this;
// @:}
//}
//}

View File

@@ -6,21 +6,20 @@ using System.Text;
namespace SqlSugar
{
public class Subqueryable<T> where T : class, new()
public partial class Subqueryable<T> where T : class, new()
{
public Subqueryable<T> AS(string tableName)
{
return this;
}
public Subqueryable<T> InnerJoin<JoinType>(Func<T, JoinType, bool> expression)
public Subqueryable<T, JoinType> InnerJoin<JoinType>(Func<T, JoinType, bool> expression)
{
return this;
return new Subqueryable<T, JoinType>();
}
public Subqueryable<T> LeftJoin<JoinType>(Func<T, JoinType, bool> expression)
public Subqueryable<T, JoinType> LeftJoin<JoinType>(Func<T, JoinType, bool> expression)
{
return this;
return new Subqueryable<T, JoinType>();
}
public Subqueryable<T> Where(string where)

View File

@@ -0,0 +1,274 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SqlSugar
{ public class Subqueryable<T1, T2, T3, T4, T5, T6, T7, T8,T9,T10> : Subqueryable<T1> where T1 : class, new()
{ }
public class Subqueryable<T1, T2, T3, T4, T5, T6, T7, T8, T9> : Subqueryable<T1> where T1 : class, new()
{
public Subqueryable<T1, T2, T3, T4, T5, T6, T7, T8, T9, JoinType> InnerJoin<JoinType>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, JoinType, bool> expression)
{
return new Subqueryable<T1, T2, T3, T4, T5, T6, T7, T8, T9, JoinType>();
}
public Subqueryable<T1, T2, T3, T4, T5, T6, T7, T8, T9, JoinType> LeftJoin<JoinType>(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, JoinType, bool> expression)
{
return new Subqueryable<T1, T2, T3, T4, T5, T6, T7, T8, T9, JoinType>();
}
public new Subqueryable<T1, T2, T3, T4, T5, T6, T7, T8, T9> Where(Func<T1, bool> expression)
{
return this;
}
public Subqueryable<T1, T2, T3, T4, T5, T6, T7, T8, T9> Where(Func<T1, T2, bool> expression)
{
return this;
}
public Subqueryable<T1, T2, T3, T4, T5, T6, T7, T8, T9> Where(Func<T1, T2, T3, bool> expression)
{
return this;
}
public Subqueryable<T1, T2, T3, T4, T5, T6, T7, T8, T9> Where(Func<T1, T2, T3, T4, bool> expression)
{
return this;
}
public Subqueryable<T1, T2, T3, T4, T5, T6, T7, T8, T9> Where(Func<T1, T2, T3, T4, T5, bool> expression)
{
return this;
}
public Subqueryable<T1, T2, T3, T4, T5, T6, T7, T8, T9> Where(Func<T1, T2, T3, T4, T5, T6, bool> expression)
{
return this;
}
public Subqueryable<T1, T2, T3, T4, T5, T6, T7, T8, T9> Where(Func<T1, T2, T3, T4, T5, T6, T7, bool> expression)
{
return this;
}
public Subqueryable<T1, T2, T3, T4, T5, T6, T7, T8, T9> Where(Func<T1, T2, T3, T4, T5, T6, T7, T8, bool> expression)
{
return this;
}
public Subqueryable<T1, T2, T3, T4, T5, T6, T7, T8, T9> Where(Func<T1, T2, T3, T4, T5, T6, T7, T8, T9, bool> expression)
{
return this;
}
}
public class Subqueryable<T1, T2, T3, T4, T5, T6, T7, T8> : Subqueryable<T1> where T1 : class, new()
{
public Subqueryable<T1, T2, T3, T4, T5, T6, T7, T8, JoinType> InnerJoin<JoinType>(Func<T1, T2, T3, T4, T5, T6, T7, T8, JoinType, bool> expression)
{
return new Subqueryable<T1, T2, T3, T4, T5, T6, T7, T8, JoinType>();
}
public Subqueryable<T1, T2, T3, T4, T5, T6, T7, T8, JoinType> LeftJoin<JoinType>(Func<T1, T2, T3, T4, T5, T6, T7, T8, JoinType, bool> expression)
{
return new Subqueryable<T1, T2, T3, T4, T5, T6, T7, T8, JoinType>();
}
public new Subqueryable<T1, T2, T3, T4, T5, T6, T7, T8> Where(Func<T1, bool> expression)
{
return this;
}
public Subqueryable<T1, T2, T3, T4, T5, T6, T7, T8> Where(Func<T1, T2, bool> expression)
{
return this;
}
public Subqueryable<T1, T2, T3, T4, T5, T6, T7, T8> Where(Func<T1, T2, T3, bool> expression)
{
return this;
}
public Subqueryable<T1, T2, T3, T4, T5, T6, T7, T8> Where(Func<T1, T2, T3, T4, bool> expression)
{
return this;
}
public Subqueryable<T1, T2, T3, T4, T5, T6, T7, T8> Where(Func<T1, T2, T3, T4, T5, bool> expression)
{
return this;
}
public Subqueryable<T1, T2, T3, T4, T5, T6, T7, T8> Where(Func<T1, T2, T3, T4, T5, T6, bool> expression)
{
return this;
}
public Subqueryable<T1, T2, T3, T4, T5, T6, T7, T8> Where(Func<T1, T2, T3, T4, T5, T6, T7, bool> expression)
{
return this;
}
public Subqueryable<T1, T2, T3, T4, T5, T6, T7, T8> Where(Func<T1, T2, T3, T4, T5, T6, T7, T8, bool> expression)
{
return this;
}
}
public class Subqueryable<T1, T2, T3, T4, T5, T6, T7> : Subqueryable<T1> where T1 : class, new()
{
public Subqueryable<T1, T2, T3, T4, T5, T6, T7, JoinType> InnerJoin<JoinType>(Func<T1, T2, T3, T4, T5, T6, T7, JoinType, bool> expression)
{
return new Subqueryable<T1, T2, T3, T4, T5, T6, T7, JoinType>();
}
public Subqueryable<T1, T2, T3, T4, T5, T6, T7, JoinType> LeftJoin<JoinType>(Func<T1, T2, T3, T4, T5, T6, T7, JoinType, bool> expression)
{
return new Subqueryable<T1, T2, T3, T4, T5, T6, T7, JoinType>();
}
public new Subqueryable<T1, T2, T3, T4, T5, T6, T7> Where(Func<T1, bool> expression)
{
return this;
}
public Subqueryable<T1, T2, T3, T4, T5, T6, T7> Where(Func<T1, T2, bool> expression)
{
return this;
}
public Subqueryable<T1, T2, T3, T4, T5, T6, T7> Where(Func<T1, T2, T3, bool> expression)
{
return this;
}
public Subqueryable<T1, T2, T3, T4, T5, T6, T7> Where(Func<T1, T2, T3, T4, bool> expression)
{
return this;
}
public Subqueryable<T1, T2, T3, T4, T5, T6, T7> Where(Func<T1, T2, T3, T4, T5, bool> expression)
{
return this;
}
public Subqueryable<T1, T2, T3, T4, T5, T6, T7> Where(Func<T1, T2, T3, T4, T5, T6, bool> expression)
{
return this;
}
public Subqueryable<T1, T2, T3, T4, T5, T6, T7> Where(Func<T1, T2, T3, T4, T5, T6, T7, bool> expression)
{
return this;
}
}
public class Subqueryable<T1, T2, T3, T4, T5, T6> : Subqueryable<T1> where T1 : class, new()
{
public Subqueryable<T1, T2, T3, T4, T5, T6, JoinType> InnerJoin<JoinType>(Func<T1, T2, T3, T4, T5, T6, JoinType, bool> expression)
{
return new Subqueryable<T1, T2, T3, T4, T5, T6, JoinType>();
}
public Subqueryable<T1, T2, T3, T4, T5, T6, JoinType> LeftJoin<JoinType>(Func<T1, T2, T3, T4, T5, T6, JoinType, bool> expression)
{
return new Subqueryable<T1, T2, T3, T4, T5, T6, JoinType>();
}
public new Subqueryable<T1, T2, T3, T4, T5, T6> Where(Func<T1, bool> expression)
{
return this;
}
public Subqueryable<T1, T2, T3, T4, T5, T6> Where(Func<T1, T2, bool> expression)
{
return this;
}
public Subqueryable<T1, T2, T3, T4, T5, T6> Where(Func<T1, T2, T3, bool> expression)
{
return this;
}
public Subqueryable<T1, T2, T3, T4, T5, T6> Where(Func<T1, T2, T3, T4, bool> expression)
{
return this;
}
public Subqueryable<T1, T2, T3, T4, T5, T6> Where(Func<T1, T2, T3, T4, T5, bool> expression)
{
return this;
}
public Subqueryable<T1, T2, T3, T4, T5, T6> Where(Func<T1, T2, T3, T4, T5, T6, bool> expression)
{
return this;
}
}
public class Subqueryable<T1, T2, T3, T4, T5> : Subqueryable<T1> where T1 : class, new()
{
public Subqueryable<T1, T2, T3, T4, T5, JoinType> InnerJoin<JoinType>(Func<T1, T2, T3, T4, T5, JoinType, bool> expression)
{
return new Subqueryable<T1, T2, T3, T4, T5, JoinType>();
}
public Subqueryable<T1, T2, T3, T4, T5, JoinType> LeftJoin<JoinType>(Func<T1, T2, T3, T4, T5, JoinType, bool> expression)
{
return new Subqueryable<T1, T2, T3, T4, T5, JoinType>();
}
public new Subqueryable<T1, T2, T3, T4, T5> Where(Func<T1, bool> expression)
{
return this;
}
public Subqueryable<T1, T2, T3, T4, T5> Where(Func<T1, T2, bool> expression)
{
return this;
}
public Subqueryable<T1, T2, T3, T4, T5> Where(Func<T1, T2, T3, bool> expression)
{
return this;
}
public Subqueryable<T1, T2, T3, T4, T5> Where(Func<T1, T2, T3, T4, bool> expression)
{
return this;
}
public Subqueryable<T1, T2, T3, T4, T5> Where(Func<T1, T2, T3, T4, T5, bool> expression)
{
return this;
}
}
public class Subqueryable<T1, T2, T3, T4> : Subqueryable<T1> where T1 : class, new()
{
public Subqueryable<T1, T2, T3, T4, JoinType> InnerJoin<JoinType>(Func<T1, T2, T3, T4, JoinType, bool> expression)
{
return new Subqueryable<T1, T2, T3, T4, JoinType>();
}
public Subqueryable<T1, T2, T3, T4, JoinType> LeftJoin<JoinType>(Func<T1, T2, T3, T4, JoinType, bool> expression)
{
return new Subqueryable<T1, T2, T3, T4, JoinType>();
}
public new Subqueryable<T1, T2, T3, T4> Where(Func<T1, bool> expression)
{
return this;
}
public Subqueryable<T1, T2, T3, T4> Where(Func<T1, T2, bool> expression)
{
return this;
}
public Subqueryable<T1, T2, T3, T4> Where(Func<T1, T2, T3, bool> expression)
{
return this;
}
public Subqueryable<T1, T2, T3, T4> Where(Func<T1, T2, T3, T4, bool> expression)
{
return this;
}
}
public class Subqueryable<T1, T2, T3> : Subqueryable<T1> where T1 : class, new()
{
public Subqueryable<T1, T2, T3, JoinType> InnerJoin<JoinType>(Func<T1, T2, T3, JoinType, bool> expression)
{
return new Subqueryable<T1, T2, T3, JoinType>();
}
public Subqueryable<T1, T2, T3, JoinType> LeftJoin<JoinType>(Func<T1, T2, T3, JoinType, bool> expression)
{
return new Subqueryable<T1, T2, T3, JoinType>();
}
public new Subqueryable<T1, T2, T3> Where(Func<T1, bool> expression)
{
return this;
}
public Subqueryable<T1, T2, T3> Where(Func<T1, T2, bool> expression)
{
return this;
}
public Subqueryable<T1, T2, T3> Where(Func<T1, T2, T3, bool> expression)
{
return this;
}
}
public class Subqueryable<T1, T2> : Subqueryable<T1> where T1 : class, new()
{
public Subqueryable<T1, T2, JoinType> InnerJoin<JoinType>(Func<T1, T2, JoinType, bool> expression)
{
return new Subqueryable<T1, T2, JoinType>();
}
public Subqueryable<T1, T2, JoinType> LeftJoin<JoinType>(Func<T1, T2, JoinType, bool> expression)
{
return new Subqueryable<T1, T2, JoinType>();
}
public new Subqueryable<T1, T2> Where(Func<T1, bool> expression)
{
return this;
}
public Subqueryable<T1, T2> Where(Func<T1, T2, bool> expression)
{
return this;
}
}
}

View File

@@ -336,7 +336,7 @@ namespace SqlSugar
addValue = null;
}
}
else if (item.PropertyType == UtilConstants.IntType)
else if (UtilMethods.GetUnderType(item.PropertyType) == UtilConstants.IntType)
{
addValue = Convert.ToInt32(addValue);
}

View File

@@ -163,6 +163,7 @@ namespace SqlSugar
void Dispose();
void Close();
void Open();
void OpenAlways();
void CheckConnection();
void BeginTran();