diff --git a/Src/Asp.Net/SqlSugar/Abstract/SaveableProvider/Storageable.cs b/Src/Asp.Net/SqlSugar/Abstract/SaveableProvider/Storageable.cs index ae16d75f3..25e5fafb8 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/SaveableProvider/Storageable.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/SaveableProvider/Storageable.cs @@ -125,31 +125,36 @@ namespace SqlSugar this.Context.Utilities.PageEach(allDatas, 300, itemList => { List conditList = new List(); - var condition = new ConditionalCollections() - { - ConditionalList = new List>() - }; - foreach (var dataItem in itemList) - { - foreach (var item in whereColumns) - { - conditList.Add(condition); - condition.ConditionalList.Add(new KeyValuePair(WhereType.And, new ConditionalModel() - { - FieldName = item.DbColumnName, - ConditionalType = ConditionalType.Equal, - FieldValue = item.PropertyInfo.GetValue(dataItem,null)+"" - })); - } - var addItem = this.Context.Queryable().Where(conditList).ToList(); - this.dbDataList.AddRange(addItem); - } + SetConditList(itemList, whereColumns, conditList); + var addItem = this.Context.Queryable().Where(conditList).ToList(); + this.dbDataList.AddRange(addItem); }); } return this; } } + private static void SetConditList(List> itemList, List whereColumns, List conditList) + { + var condition = new ConditionalCollections() + { + ConditionalList = new List>() + }; + foreach (var dataItem in itemList) + { + foreach (var item in whereColumns) + { + conditList.Add(condition); + condition.ConditionalList.Add(new KeyValuePair(WhereType.And, new ConditionalModel() + { + FieldName = item.DbColumnName, + ConditionalType = ConditionalType.Equal, + FieldValue = item.PropertyInfo.GetValue(dataItem, null) + "" + })); + } + } + } + public virtual ExpressionResult GetExpressionValue(Expression expression, ResolveExpressType resolveType) { ILambdaExpressions resolveExpress = InstanceFactory.GetLambdaExpressions(this.Context.CurrentConnectionConfig); ;