mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-06-28 13:34:32 +08:00
Update Demo
This commit is contained in:
parent
070315c1e5
commit
8df102e19a
@ -9,7 +9,7 @@ namespace PerformanceTest
|
||||
public class Config
|
||||
{
|
||||
public static string connectionString = "server=.;uid=sa;pwd=sasa;database=SqlSugarTest";
|
||||
public static ConnectionConfig SugarConfig =new ConnectionConfig() { InitKeyType = InitKeyType.SystemTable, ConnectionString = Config.connectionString, DbType = DbType.SqlServer };
|
||||
public static ConnectionConfig SugarConfig =new ConnectionConfig() { IsAutoCloseConnection=true,InitKeyType = InitKeyType.SystemTable, ConnectionString = Config.connectionString, DbType = DbType.SqlServer };
|
||||
public static SqlSugarClient GetSugarConn()
|
||||
{
|
||||
return new SqlSugarClient(SugarConfig);
|
||||
|
@ -16,7 +16,7 @@ namespace PerformanceTest
|
||||
static void Main(string[] args)
|
||||
{
|
||||
var type = DemoType.GetSql;
|
||||
var ormType = OrmType.SqlSugar;
|
||||
var ormType = OrmType.Dapper;
|
||||
switch (type)
|
||||
{
|
||||
case DemoType.GetAll:
|
||||
|
@ -44,10 +44,8 @@ namespace PerformanceTest.TestItems
|
||||
|
||||
PerHelper.Execute(eachCount, "SqlSugar", () =>
|
||||
{
|
||||
using (SqlSugarClient conn = Config.GetSugarConn())
|
||||
{
|
||||
SqlSugarClient conn = Config.GetSugarConn();
|
||||
var list2 = conn.Ado.SqlQuery<Test>("select top 20 * from Test"); ;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -246,8 +246,15 @@ namespace SqlSugar
|
||||
|
||||
public static IAdo GetAdo(ConnectionConfig currentConnectionConfig)
|
||||
{
|
||||
IAdo result = CreateInstance<IAdo>(GetClassName(currentConnectionConfig.DbType.ToString(), "Provider"));
|
||||
return result;
|
||||
if (currentConnectionConfig.DbType == DbType.SqlServer)
|
||||
{
|
||||
return new SqlServerProvider();
|
||||
}
|
||||
else
|
||||
{
|
||||
IAdo result = CreateInstance<IAdo>(GetClassName(currentConnectionConfig.DbType.ToString(), "Provider"));
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetClassName(string type, string name)
|
||||
|
Loading…
Reference in New Issue
Block a user