From c81ac9b3055311cc84ebbac74a58d115df0214c0 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Wed, 12 Jul 2023 17:34:22 +0800 Subject: [PATCH] Add demo --- Src/Asp.Net/SqlServerTest/Demo/Demo2_Updateable.cs | 5 +++++ Src/Asp.Net/SqlServerTest/Demo/Demo4_Deleteable.cs | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/Src/Asp.Net/SqlServerTest/Demo/Demo2_Updateable.cs b/Src/Asp.Net/SqlServerTest/Demo/Demo2_Updateable.cs index 106d93795..16527c23a 100644 --- a/Src/Asp.Net/SqlServerTest/Demo/Demo2_Updateable.cs +++ b/Src/Asp.Net/SqlServerTest/Demo/Demo2_Updateable.cs @@ -172,6 +172,11 @@ namespace OrmTest //.SetColumns("price", 1) .Where("id=1").ExecuteCommand(); + db.Updateable() + .AS("order") + .SetColumns(it=>it.Name=="a") + .Where(it => SqlFunc.Subqueryable().AS("order").Where(s => s.Id == it.Id).NotAny()).ExecuteCommand(); + object o = db.Queryable().First(); db.UpdateableByObject(o).ExecuteCommandAsync().GetAwaiter().GetResult(); object os = db.Queryable().Take(2).ToList(); diff --git a/Src/Asp.Net/SqlServerTest/Demo/Demo4_Deleteable.cs b/Src/Asp.Net/SqlServerTest/Demo/Demo4_Deleteable.cs index 5b9dd5a18..be37dd2b6 100644 --- a/Src/Asp.Net/SqlServerTest/Demo/Demo4_Deleteable.cs +++ b/Src/Asp.Net/SqlServerTest/Demo/Demo4_Deleteable.cs @@ -60,6 +60,10 @@ namespace OrmTest db.DeleteableByObject(o).ExecuteCommandAsync().GetAwaiter().GetResult(); object os = db.Queryable().Take(2).ToList(); db.DeleteableByObject(os).ExecuteCommand(); + + db.Deleteable() + .AS("order") + .Where(it =>SqlFunc.Subqueryable().AS("order").Where(s=>s.Id==it.Id).NotAny() ).ExecuteCommand(); Console.WriteLine("#### Deleteable End ####"); }