diff --git a/Src/Asp.Net/SqlSugar/Abstract/SaveableProvider/Storageable.cs b/Src/Asp.Net/SqlSugar/Abstract/SaveableProvider/Storageable.cs index 025a90fd9..0c161b024 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/SaveableProvider/Storageable.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/SaveableProvider/Storageable.cs @@ -19,6 +19,7 @@ namespace SqlSugar Func formatTime; DbLockType? lockType; private string asname { get; set; } + private bool isDisableFilters = false; public Storageable(List datas, SqlSugarProvider context) { this.Context = context; @@ -64,6 +65,12 @@ namespace SqlSugar return this; } + public IStorageable DisableFilters() + { + this.isDisableFilters = true; + return this; + } + public IStorageable TranLock(DbLockType dbLockType = DbLockType.Wait) { this.lockType = dbLockType; @@ -120,7 +127,7 @@ namespace SqlSugar if (whereExpression == null && pkInfos.Any()) { this.Context.Utilities.PageEach(allDatas, 300, item => { - var addItems=this.Context.Queryable().TranLock(this.lockType).AS(asname).WhereClassByPrimaryKey(item.Select(it => it.Item).ToList()).ToList(); + var addItems=this.Context.Queryable().Filter(null, this.isDisableFilters).TranLock(this.lockType).AS(asname).WhereClassByPrimaryKey(item.Select(it => it.Item).ToList()).ToList(); dbDataList.AddRange(addItems); }); } @@ -202,7 +209,7 @@ namespace SqlSugar if (whereExpression == null && pkInfos.Any()) { await this.Context.Utilities.PageEachAsync(allDatas, 300,async item => { - var addItems =await this.Context.Queryable().AS(asname).TranLock(this.lockType).WhereClassByPrimaryKey(item.Select(it => it.Item).ToList()).ToListAsync(); + var addItems =await this.Context.Queryable().Filter(null,this.isDisableFilters).AS(asname).TranLock(this.lockType).WhereClassByPrimaryKey(item.Select(it => it.Item).ToList()).ToListAsync(); dbDataList.AddRange(addItems); }); } diff --git a/Src/Asp.Net/SqlSugar/Interface/IStorageable.cs b/Src/Asp.Net/SqlSugar/Interface/IStorageable.cs index f35e0ba47..097b68d38 100644 --- a/Src/Asp.Net/SqlSugar/Interface/IStorageable.cs +++ b/Src/Asp.Net/SqlSugar/Interface/IStorageable.cs @@ -17,6 +17,7 @@ namespace SqlSugar IStorageable Saveable(string inserMessage = null, string updateMessage = null); IStorageable SplitError(Func, bool> conditions, string message = null); IStorageable SplitIgnore(Func, bool> conditions, string message = null); + IStorageable DisableFilters(); IStorageable TranLock(DbLockType LockType = DbLockType.Wait); IStorageable SplitDelete(Func, bool> conditions, string message = null); IStorageable SplitOther(Func, bool> conditions, string message = null);