Browse Source

Update demo

pull/12/MERGE
skx 5 years ago
parent
commit
89656e9055
  1. 2
      Src/Asp.Net/PerformanceTest/Program.cs
  2. 13
      Src/Asp.Net/PerformanceTest/TestItems/TestInsert.cs

2
Src/Asp.Net/PerformanceTest/Program.cs

@ -19,7 +19,7 @@ namespace PerformanceTest
InitData();
var type = DemoType.Insert;
var ormType = OrmType.SqlSugar;
var ormType = OrmType.EF;
switch (type)
{
case DemoType.GetAll:

13
Src/Asp.Net/PerformanceTest/TestItems/TestInsert.cs

@ -57,7 +57,7 @@ namespace PerformanceTest.TestItems
//删除插入数据
Config.GetSugarConn().Deleteable<Test>().Where(it => it.F_String == "test").ExecuteCommand();
DeleteAddData();
}
private static void Dapper(int eachCount)
@ -74,7 +74,7 @@ namespace PerformanceTest.TestItems
});
//删除插入数据
Config.GetSugarConn().Deleteable<Test>().Where(it => it.F_String == "test").ExecuteCommand();
DeleteAddData();
}
private static void EF(int eachCount)
@ -87,11 +87,18 @@ namespace PerformanceTest.TestItems
using (EFContext conn = new EFContext(Config.connectionString))
{
conn.Set<Test>().Add(GetData());
conn.SaveChanges();
}
});
//删除插入数据
Config.GetSugarConn().Deleteable<Test>().Where(it => it.F_String == "test").ExecuteCommand();
DeleteAddData();
}
private static void DeleteAddData()
{
var count=Config.GetSugarConn().Deleteable<Test>().Where(it => it.F_String == "test").ExecuteCommand();
Console.WriteLine("删除:刚插入" + count + "条");
}
private static Test GetData()

Loading…
Cancel
Save