From 146a83abdfcca472fb651da991b410bc32345bae Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Thu, 21 Sep 2017 14:24:53 +0800 Subject: [PATCH] - --- Src/Asp.Net/PerformanceTest/Common/PerHelper.cs | 2 +- Src/Asp.Net/PerformanceTest/Config.cs | 2 +- Src/Asp.Net/PerformanceTest/Program.cs | 2 +- Src/Asp.Net/PerformanceTest/TestItems/TestGetById.cs | 5 ++--- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Src/Asp.Net/PerformanceTest/Common/PerHelper.cs b/Src/Asp.Net/PerformanceTest/Common/PerHelper.cs index 9db30d291..d38be0631 100644 --- a/Src/Asp.Net/PerformanceTest/Common/PerHelper.cs +++ b/Src/Asp.Net/PerformanceTest/Common/PerHelper.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; using SqlSugar; -namespace PerformanceTest.Items +namespace PerformanceTest { /// /// 性能测试类,用于循环执行代码并统计时间 diff --git a/Src/Asp.Net/PerformanceTest/Config.cs b/Src/Asp.Net/PerformanceTest/Config.cs index 45d010b43..323ec4b14 100644 --- a/Src/Asp.Net/PerformanceTest/Config.cs +++ b/Src/Asp.Net/PerformanceTest/Config.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; -namespace PerformanceTest.Items +namespace PerformanceTest { public class Config { diff --git a/Src/Asp.Net/PerformanceTest/Program.cs b/Src/Asp.Net/PerformanceTest/Program.cs index e9de559ea..368e27ff9 100644 --- a/Src/Asp.Net/PerformanceTest/Program.cs +++ b/Src/Asp.Net/PerformanceTest/Program.cs @@ -15,7 +15,7 @@ namespace PerformanceTest /// static void Main(string[] args) { - new TestGetAll().Init(); + //new TestGetAll().Init(); new TestGetById().Init(); Console.ReadKey(); } diff --git a/Src/Asp.Net/PerformanceTest/TestItems/TestGetById.cs b/Src/Asp.Net/PerformanceTest/TestItems/TestGetById.cs index 7015c6709..46aeb1758 100644 --- a/Src/Asp.Net/PerformanceTest/TestItems/TestGetById.cs +++ b/Src/Asp.Net/PerformanceTest/TestItems/TestGetById.cs @@ -1,5 +1,4 @@ using Dapper.Contrib.Extensions; -using PerformanceTest.Items; using SqlSugar; using System; using System.Collections.Generic; @@ -43,7 +42,7 @@ namespace PerformanceTest.TestItems { using (SqlSugarClient conn = new SqlSugarClient(new ConnectionConfig() { InitKeyType = InitKeyType.SystemTable, ConnectionString = Config.connectionString, DbType = DbType.SqlServer })) { - var list2 = conn.Queryable().ToList(); + var list2 = conn.Queryable().InSingle(1); } }); } @@ -57,7 +56,7 @@ namespace PerformanceTest.TestItems { using (SqlConnection conn = new SqlConnection(Config.connectionString)) { - var list = conn.GetAll(); + var list = conn.Get(1); } }); }