Browse Source

Delete Bug

pull/12/MERGE
sunkaixuan 8 years ago
parent
commit
1f6b7dc90d
  1. 4
      Src/Asp.Net/SqlServerTest/Demos/4_Delete.cs
  2. 1
      Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/DeleteBuilder.cs

4
Src/Asp.Net/SqlServerTest/Demos/4_Delete.cs

@ -26,8 +26,8 @@ namespace OrmTest.Demo
//by primary key array //by primary key array
var t4 = db.Deleteable<Student>().In(new int[] { 1, 2 }).ExecuteCommand(); var t4 = db.Deleteable<Student>().In(new int[] { 1, 2 }).ExecuteCommand();
//by expression //by expression id>1 and id==1
var t5 = db.Deleteable<Student>().Where(it => it.Id == 1).ExecuteCommand(); var t5 = db.Deleteable<Student>().Where(it => it.Id > 1).Where(it => it.Id == 1).ExecuteCommand();
} }
} }
} }

1
Src/Asp.Net/SqlSugar/Abstract/SqlBuilderProvider/DeleteBuilder.cs

@ -125,6 +125,7 @@ namespace SqlSugar
resolveExpress.MappingTables = Context.MappingTables; resolveExpress.MappingTables = Context.MappingTables;
resolveExpress.IgnoreComumnList = Context.IgnoreColumns; resolveExpress.IgnoreComumnList = Context.IgnoreColumns;
resolveExpress.Resolve(expression, resolveType); resolveExpress.Resolve(expression, resolveType);
if (this.Parameters == null)
this.Parameters = new List<SugarParameter>(); this.Parameters = new List<SugarParameter>();
this.Parameters.AddRange(resolveExpress.Parameters); this.Parameters.AddRange(resolveExpress.Parameters);
var reval = resolveExpress.Result; var reval = resolveExpress.Result;

Loading…
Cancel
Save