From 0a18eb18f1ea924e0ca67a65b220ced6171d9123 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Sun, 21 May 2023 17:58:40 +0800 Subject: [PATCH] Add demo --- Src/Asp.Net/PgSqlTest/Demo/Demo2_Updateable.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Src/Asp.Net/PgSqlTest/Demo/Demo2_Updateable.cs b/Src/Asp.Net/PgSqlTest/Demo/Demo2_Updateable.cs index 26f1c5e9f..5ac4c10d8 100644 --- a/Src/Asp.Net/PgSqlTest/Demo/Demo2_Updateable.cs +++ b/Src/Asp.Net/PgSqlTest/Demo/Demo2_Updateable.cs @@ -64,7 +64,16 @@ namespace OrmTest .PublicSetColumns(it => it.Price, it => it.Price + 1) .ExecuteCommand(); - + var list = db.Queryable().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