mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-12-21 19:09:57 +08:00
Code optimization
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user