This commit is contained in:
sunkaixuan
2017-05-24 21:23:59 +08:00
parent cee667117a
commit f652bc3ddc
4 changed files with 12 additions and 6 deletions

View File

@@ -44,6 +44,11 @@ namespace OrmTest.Demo
//Where By Expression
var t9 = db.Updateable(updateObj).Where(it => it.Id == 1).ExecuteCommand();
//Where
var t10= db.Updateable<Student>()
.UpdateColumns(it => new Student() { Name = "jack", SchoolId =1 })
.Where(it => it.Id == 11).ExecuteCommand();
}
public static SqlSugarClient GetInstance()
{

View File

@@ -119,8 +119,8 @@ UNION ALL
string name = "x";
var t10 = db.Updateable<Student>().UpdateColumns(it => new Student() { Name =name, SchoolId=updateObj.SchoolId }).Where(it=>it.Id==11).ToSql();
base.Check(@"UPDATE [Student] SET
[SchoolId] = [@Const0] , [Name] = [@constant1] WHERE ( [Id] = @Id1 )", new List<SugarParameter>() {
new SugarParameter("@constant1","x"),
[SchoolId] = @Const0 , [Name] = @const3 WHERE ( [Id] = @Id1 )", new List<SugarParameter>() {
new SugarParameter("@const3","x"),
new SugarParameter("@Const0",18),
new SugarParameter("@Id1",11)},
t10.Key,