diff --git a/Src/Asp.Net/SqlServerTest/Demos/4_Delete.cs b/Src/Asp.Net/SqlServerTest/Demos/4_Delete.cs index 960434203..1276ea3ee 100644 --- a/Src/Asp.Net/SqlServerTest/Demos/4_Delete.cs +++ b/Src/Asp.Net/SqlServerTest/Demos/4_Delete.cs @@ -26,8 +26,8 @@ namespace OrmTest.Demo //by primary key array var t4 = db.Deleteable().In(new int[] { 1, 2 }).ExecuteCommand(); - //by expression - var t5 = db.Deleteable().Where(it => it.Id == 1).ExecuteCommand(); + //by expression id>1 and id==1 + var t5 = db.Deleteable().Where(it => it.Id > 1).Where(it => it.Id == 1).ExecuteCommand(); } } } diff --git a/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/DeleteBuilder.cs b/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/DeleteBuilder.cs index 7f99e5703..3fb867aa7 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/DeleteBuilder.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/DeleteBuilder.cs @@ -125,11 +125,12 @@ namespace SqlSugar resolveExpress.MappingTables = Context.MappingTables; resolveExpress.IgnoreComumnList = Context.IgnoreColumns; resolveExpress.Resolve(expression, resolveType); - this.Parameters = new List(); + if (this.Parameters == null) + this.Parameters = new List(); this.Parameters.AddRange(resolveExpress.Parameters); var reval = resolveExpress.Result; return reval; - } + } #endregion } }