Code optimization

This commit is contained in:
sunkaixuan
2017-11-22 18:51:40 +08:00
parent c79d2b3cf8
commit d861bca078
2 changed files with 38 additions and 11 deletions

View File

@@ -64,7 +64,13 @@ namespace OrmTest.Demo
t12.Wait();
//update one columns
var count= db.Updateable<Student>().UpdateColumns(it => it.SchoolId == 1).Where(it => it.Id == 1).ExecuteCommand();
var count = db.Updateable<Student>().UpdateColumns(it => it.SchoolId == 1).Where(it => it.Id == 1).ExecuteCommand();
var t13 = db.Updateable<Student>().UpdateColumns(it => new Student() {
SchoolId = SqlFunc.Subqueryable<School>().Where(s=>s.Id==it.SchoolId).Select(s=>s.Id),
Name="newname"
}).Where(it => it.Id == 1).ExecuteCommand();
}
}
}