diff --git a/Src/Asp.Net/SqlSugar/Abstract/DeleteProvider/DeleteableProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/DeleteProvider/DeleteableProvider.cs index a15c56f0a..204721e21 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/DeleteProvider/DeleteableProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/DeleteProvider/DeleteableProvider.cs @@ -568,7 +568,7 @@ namespace SqlSugar { List result = new List(); var whereSql = Regex.Replace(sql, ".* WHERE ", "", RegexOptions.Singleline); - var dt = this.Context.Queryable().Where(whereSql).AddParameters(parameters).ToDataTable(); + var dt = this.Context.Queryable().Filter(null, true).Where(whereSql).AddParameters(parameters).ToDataTable(); if (dt.Rows != null && dt.Rows.Count > 0) { foreach (DataRow row in dt.Rows) diff --git a/Src/Asp.Net/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs index 19a0eeab4..7cbd819a4 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs @@ -876,7 +876,7 @@ namespace SqlSugar { whereSql=Regex.Match(sql, @"\(EXISTS.+").Value; } - dt = this.Context.Queryable().Where(whereSql).AddParameters(parameters).ToDataTable(); + dt = this.Context.Queryable().Filter(null, true).Where(whereSql).AddParameters(parameters).ToDataTable(); } else { @@ -886,7 +886,7 @@ namespace SqlSugar } else { - dt = this.Context.Queryable().WhereClassByPrimaryKey(this.UpdateObjs.ToList()).ToDataTable(); + dt = this.Context.Queryable().Filter(null, true).WhereClassByPrimaryKey(this.UpdateObjs.ToList()).ToDataTable(); } } if (dt.Rows != null && dt.Rows.Count > 0)