Update pg sql

This commit is contained in:
sunkaixuan
2023-05-07 22:18:16 +08:00
parent 2862cb83b2
commit bc7e823e93
2 changed files with 25 additions and 0 deletions

View File

@@ -54,7 +54,15 @@ 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 result67 =
db.Updateable(updateObjs)
.PublicSetColumns(it => it.Price, it => it.Price + 1)
.ExecuteCommand();
var result68 =
db.Updateable(updateObjs.First())
.PublicSetColumns(it => it.Price, it => it.Price + 1)
.ExecuteCommand();
/*** 2.by expression ***/