From 96eadee09a4377eb1f11727b94645c24142741d3 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Mon, 26 Dec 2022 15:29:20 +0800 Subject: [PATCH] Add demo --- Src/Asp.Net/SqlServerTest/Demo/Demo2_Updateable.cs | 6 ++++++ Src/Asp.Net/SqlServerTest/Demo/Demo4_Deleteable.cs | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/Src/Asp.Net/SqlServerTest/Demo/Demo2_Updateable.cs b/Src/Asp.Net/SqlServerTest/Demo/Demo2_Updateable.cs index 7a78676e0..83fa52867 100644 --- a/Src/Asp.Net/SqlServerTest/Demo/Demo2_Updateable.cs +++ b/Src/Asp.Net/SqlServerTest/Demo/Demo2_Updateable.cs @@ -133,6 +133,12 @@ namespace OrmTest .SetColumns("name", 1) .SetColumns("price", 1) .Where("id=1").ExecuteCommand(); + + + object o = db.Queryable().First(); + db.UpdateableByObject(o).ExecuteCommand(); + object os = db.Queryable().Take(2).ToList(); + db.UpdateableByObject(os).ExecuteCommand(); Console.WriteLine("#### Updateable End ####"); } diff --git a/Src/Asp.Net/SqlServerTest/Demo/Demo4_Deleteable.cs b/Src/Asp.Net/SqlServerTest/Demo/Demo4_Deleteable.cs index 11d7e6331..cd77077ea 100644 --- a/Src/Asp.Net/SqlServerTest/Demo/Demo4_Deleteable.cs +++ b/Src/Asp.Net/SqlServerTest/Demo/Demo4_Deleteable.cs @@ -54,6 +54,12 @@ namespace OrmTest db.CodeFirst.InitTables(); ; db.Deleteable().Where(it=>it.Id==1).IsLogic().ExecuteCommand(); + + + object o = db.Queryable().First(); + db.DeleteableByObject(o).ExecuteCommand(); + object os = db.Queryable().Take(2).ToList(); + db.DeleteableByObject(os).ExecuteCommand(); Console.WriteLine("#### Deleteable End ####"); }