Browse Source

Add demo

pull/30/head
sunkaixuan 2 years ago
parent
commit
96eadee09a
  1. 6
      Src/Asp.Net/SqlServerTest/Demo/Demo2_Updateable.cs
  2. 6
      Src/Asp.Net/SqlServerTest/Demo/Demo4_Deleteable.cs

6
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<Order>().First();
db.UpdateableByObject(o).ExecuteCommand();
object os = db.Queryable<Order>().Take(2).ToList();
db.UpdateableByObject(os).ExecuteCommand();
Console.WriteLine("#### Updateable End ####");
}

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

@ -54,6 +54,12 @@ namespace OrmTest
db.CodeFirst.InitTables<LogicTest>();
;
db.Deleteable<LogicTest>().Where(it=>it.Id==1).IsLogic().ExecuteCommand();
object o = db.Queryable<Order>().First();
db.DeleteableByObject(o).ExecuteCommand();
object os = db.Queryable<Order>().Take(2).ToList();
db.DeleteableByObject(os).ExecuteCommand();
Console.WriteLine("#### Deleteable End ####");
}

Loading…
Cancel
Save