Browse Source

Update demo

pull/32/head
sunkaixuan 2 years ago
parent
commit
4900510929
  1. 9
      Src/Asp.NetCore2/SqlSeverTest/Demo/Demo8_Saveable.cs

9
Src/Asp.NetCore2/SqlSeverTest/Demo/Demo8_Saveable.cs

@ -32,14 +32,9 @@ namespace OrmTest
//insert or update
db.Saveable<Order>(new Order() { Id=1, Name="jack" }).ExecuteReturnEntity();
db.Storageable<Order>(new Order() { Id=1, Name="jack" }).ExecuteCommand();
//insert or update
db.Saveable<Order>(new Order() { Id = 1000, Name = "jack", CreateTime=DateTime.Now })
.InsertColumns(it => new { it.Name,it.CreateTime, it.Price})//if insert into name,CreateTime,Price
.UpdateColumns(it => new { it.Name, it.CreateTime })//if update set name CreateTime
.ExecuteReturnEntity();
Console.WriteLine("");
Console.WriteLine("#### Saveable End ####");

Loading…
Cancel
Save