Browse Source

Update Demo

pull/12/MERGE
sunkaixuan 6 years ago
parent
commit
f338385485
  1. 18
      Src/Asp.Net/SqlServerTest/Program.cs
  2. 5
      Src/Asp.Net/SqlServerTest/UnitTest/Updateable.cs

18
Src/Asp.Net/SqlServerTest/Program.cs

@ -8,17 +8,17 @@ namespace OrmTest
{
static void Main(string[] args)
{
// OldTestMain.Init();
//OldTestMain.Init();
//Demo
//Demo0_SqlSugarClient.Init();
//Demo1_Queryable.Init();
//Demo2_Updateable.Init();
//Democ_GobalFilter.Init();
//DemoD_DbFirst.Init();
//DemoE_CodeFirst.Init();
//Demo5_SqlQueryable.Init();
//Demo6_Queue.Init();
Demo0_SqlSugarClient.Init();
Demo1_Queryable.Init();
Demo2_Updateable.Init();
Democ_GobalFilter.Init();
DemoD_DbFirst.Init();
DemoE_CodeFirst.Init();
Demo5_SqlQueryable.Init();
Demo6_Queue.Init();
//Unit test
NewUnitTest.Init();

5
Src/Asp.Net/SqlServerTest/UnitTest/Updateable.cs

@ -18,8 +18,11 @@ namespace OrmTest
Db.CodeFirst.InitTables(typeof(BoolTest));
var x = new BoolTest();
Db.Updateable<BoolTest>().SetColumns(it => new BoolTest() { BoolValue = !it.BoolValue }).Where(it=>it.Id==1).ExecuteCommand();
Db.Updateable<BoolTest>().SetColumns(it => it.BoolValue == !it.BoolValue ).Where(it=>it.Id==1).ExecuteCommand();
Db.Updateable<BoolTest>().SetColumns(it => new BoolTest() { BoolValue = x.BoolValue }).Where(it => it.Id == 1).ExecuteCommand();
Db.Updateable<BoolTest>().SetColumns(it => it.BoolValue == x.BoolValue).Where(it => it.Id == 1).ExecuteCommand();
Db.Updateable<BoolTest>().SetColumns(it => new BoolTest() { BoolValue = !x.BoolValue }).Where(it => it.Id == 1).ExecuteCommand();
Db.Updateable<BoolTest>().SetColumns(it => it.BoolValue == !x.BoolValue).Where(it => it.Id == 1).ExecuteCommand();
}
}

Loading…
Cancel
Save