Browse Source

Add demo

pull/40/head
sunkaixuan 1 year ago
parent
commit
c81ac9b305
  1. 5
      Src/Asp.Net/SqlServerTest/Demo/Demo2_Updateable.cs
  2. 4
      Src/Asp.Net/SqlServerTest/Demo/Demo4_Deleteable.cs

5
Src/Asp.Net/SqlServerTest/Demo/Demo2_Updateable.cs

@ -172,6 +172,11 @@ namespace OrmTest
//.SetColumns("price", 1)
.Where("id=1").ExecuteCommand();
db.Updateable<Custom>()
.AS("order")
.SetColumns(it=>it.Name=="a")
.Where(it => SqlFunc.Subqueryable<Custom>().AS("order").Where(s => s.Id == it.Id).NotAny()).ExecuteCommand();
object o = db.Queryable<Order>().First();
db.UpdateableByObject(o).ExecuteCommandAsync().GetAwaiter().GetResult();
object os = db.Queryable<Order>().Take(2).ToList();

4
Src/Asp.Net/SqlServerTest/Demo/Demo4_Deleteable.cs

@ -60,6 +60,10 @@ namespace OrmTest
db.DeleteableByObject(o).ExecuteCommandAsync().GetAwaiter().GetResult();
object os = db.Queryable<Order>().Take(2).ToList();
db.DeleteableByObject(os).ExecuteCommand();
db.Deleteable<Custom>()
.AS("order")
.Where(it =>SqlFunc.Subqueryable<Custom>().AS("order").Where(s=>s.Id==it.Id).NotAny() ).ExecuteCommand();
Console.WriteLine("#### Deleteable End ####");
}

Loading…
Cancel
Save