This commit is contained in:
sunkaixuan
2017-09-21 14:46:29 +08:00
parent c34232ab43
commit 9524dbce95
4 changed files with 11 additions and 5 deletions

View File

@@ -40,13 +40,14 @@ namespace PerformanceTest.TestItems
PerHelper.Execute(eachCount, "SqlSugar", () =>
{
using (SqlSugarClient conn = new SqlSugarClient(new ConnectionConfig() { InitKeyType=InitKeyType.SystemTable, ConnectionString= Config.connectionString, DbType=DbType.SqlServer }))
using (SqlSugarClient conn = Config.GetSugarConn())
{
var list2 = conn.Queryable<Test>().ToList();
var list2 = conn.Queryable<Test>().ToList();
}
});
}
private static void Dapper(int eachCount)
{
GC.Collect();//回收资源

View File

@@ -40,7 +40,7 @@ namespace PerformanceTest.TestItems
PerHelper.Execute(eachCount, "SqlSugar", () =>
{
using (SqlSugarClient conn = new SqlSugarClient(new ConnectionConfig() { InitKeyType = InitKeyType.SystemTable, ConnectionString = Config.connectionString, DbType = DbType.SqlServer }))
using (SqlSugarClient conn = Config.GetSugarConn())
{
var list2 = conn.Queryable<Test>().InSingle(1);
}

View File

@@ -38,7 +38,7 @@ namespace PerformanceTest.TestItems
PerHelper.Execute(eachCount, "SqlSugar", () =>
{
using (SqlSugarClient conn = new SqlSugarClient(new ConnectionConfig() { InitKeyType = InitKeyType.SystemTable, ConnectionString = Config.connectionString, DbType = DbType.SqlServer }))
using (SqlSugarClient conn = Config.GetSugarConn())
{
var list2 = conn.Ado.SqlQuery<Test>("select top 10 * from Test"); ;
}