mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
Add demo
This commit is contained in:
parent
335f9bd690
commit
45ff6d39ff
@ -55,6 +55,16 @@ namespace OrmTest
|
||||
var result6 = db.Updateable(updateObjs).WhereColumns(it => new { it.Id }).ExecuteCommand();//update List<Class> by id
|
||||
|
||||
|
||||
var list = db.Queryable<Order>().OrderBy(it => it.Id).Take(2).ToList();
|
||||
if (list.Count >= 2)
|
||||
{
|
||||
list[0].Price = 10;
|
||||
list[1].Price = 2;
|
||||
var result69 =
|
||||
db.Updateable(list)
|
||||
.PublicSetColumns(it => it.Price, "+")
|
||||
.ExecuteCommand();
|
||||
}
|
||||
|
||||
|
||||
/*** 2.by expression ***/
|
||||
|
@ -2,7 +2,7 @@
|
||||
<package >
|
||||
<metadata>
|
||||
<id>SqlSugarCore</id>
|
||||
<version>5.1.4.73</version>
|
||||
<version>5.1.4.77-preview02</version>
|
||||
<authors>sunkaixuan</authors>
|
||||
<owners>果糖大数据科技</owners>
|
||||
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>
|
||||
|
@ -54,9 +54,16 @@ namespace OrmTest
|
||||
var result5 = db.Updateable(updateObj).WhereColumns(it => new { it.Id }).ExecuteCommand();//update single by id
|
||||
var result6 = db.Updateable(updateObjs).WhereColumns(it => new { it.Id }).ExecuteCommand();//update List<Class> by id
|
||||
|
||||
|
||||
|
||||
|
||||
var list = db.Queryable<Order>().OrderBy(it => it.Id).Take(2).ToList();
|
||||
if (list.Count >= 2)
|
||||
{
|
||||
list[0].Price = 10;
|
||||
list[1].Price = 2;
|
||||
var result69 =
|
||||
db.Updateable(list)
|
||||
.PublicSetColumns(it => it.Price, "+")
|
||||
.ExecuteCommand();
|
||||
}
|
||||
/*** 2.by expression ***/
|
||||
|
||||
//update name,createtime
|
||||
|
Loading…
Reference in New Issue
Block a user