This commit is contained in:
sunkaixuan
2017-05-23 06:16:59 +08:00
parent edddbdbd25
commit 8b2c3fd122
17 changed files with 19 additions and 19 deletions

View File

@@ -32,7 +32,7 @@ namespace OrmTest.Demo
public static SqlSugarClient GetInstance() public static SqlSugarClient GetInstance()
{ {
SqlSugarClient db = new SqlSugarClient(new SystemTablesConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer, IsAutoCloseConnection = true }); SqlSugarClient db = new SqlSugarClient(new SystemTableConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer, IsAutoCloseConnection = true });
db.Ado.IsEnableLogEvent = true; db.Ado.IsEnableLogEvent = true;
db.Ado.LogEventStarting = (sql, pars) => db.Ado.LogEventStarting = (sql, pars) =>
{ {

View File

@@ -53,7 +53,7 @@ namespace OrmTest.Demo
public static SqlSugarClient GetInstance() public static SqlSugarClient GetInstance()
{ {
SqlSugarClient db = new SqlSugarClient(new SystemTablesConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer, IsAutoCloseConnection = true }); SqlSugarClient db = new SqlSugarClient(new SystemTableConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer, IsAutoCloseConnection = true });
db.Ado.IsEnableLogEvent = true; db.Ado.IsEnableLogEvent = true;
db.Ado.LogEventStarting = (sql, pars) => db.Ado.LogEventStarting = (sql, pars) =>
{ {

View File

@@ -186,7 +186,7 @@ namespace OrmTest.Demo
public static SqlSugarClient GetInstance() public static SqlSugarClient GetInstance()
{ {
SqlSugarClient db = new SqlSugarClient(new SystemTablesConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer, IsAutoCloseConnection = true }); SqlSugarClient db = new SqlSugarClient(new SystemTableConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer, IsAutoCloseConnection = true });
db.Ado.IsEnableLogEvent = true; db.Ado.IsEnableLogEvent = true;
db.Ado.LogEventStarting = (sql, pars) => db.Ado.LogEventStarting = (sql, pars) =>
{ {

View File

@@ -47,7 +47,7 @@ namespace OrmTest.Demo
} }
public static SqlSugarClient GetInstance() public static SqlSugarClient GetInstance()
{ {
SqlSugarClient db = new SqlSugarClient(new SystemTablesConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer, IsAutoCloseConnection = true }); SqlSugarClient db = new SqlSugarClient(new SystemTableConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer, IsAutoCloseConnection = true });
db.Ado.IsEnableLogEvent = true; db.Ado.IsEnableLogEvent = true;
db.Ado.LogEventStarting = (sql, pars) => db.Ado.LogEventStarting = (sql, pars) =>
{ {

View File

@@ -16,7 +16,7 @@ namespace OrmTest.PerformanceTesting
} }
public void Select() public void Select()
{ {
SqlSugarClient db = new SqlSugarClient(new SystemTablesConfig() SqlSugarClient db = new SqlSugarClient(new SystemTableConfig()
{ {
ConnectionString = Config.ConnectionString, ConnectionString = Config.ConnectionString,
DbType = DbType.SqlServer, DbType = DbType.SqlServer,

View File

@@ -55,7 +55,7 @@ namespace OrmTest
public SqlSugarClient GetInstance() public SqlSugarClient GetInstance()
{ {
SqlSugarClient db = new SqlSugarClient(new SystemTablesConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer, IsAutoCloseConnection = true }); SqlSugarClient db = new SqlSugarClient(new SystemTableConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer, IsAutoCloseConnection = true });
return db; return db;
} }
} }

View File

@@ -118,7 +118,7 @@ INSERT INTO [Student]
public SqlSugarClient GetInstance() public SqlSugarClient GetInstance()
{ {
SqlSugarClient db = new SqlSugarClient(new SystemTablesConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer, IsAutoCloseConnection = true }); SqlSugarClient db = new SqlSugarClient(new SystemTableConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer, IsAutoCloseConnection = true });
return db; return db;
} }
} }

View File

@@ -71,7 +71,7 @@ namespace OrmTest.UnitTest
public SqlSugarClient GetInstance() public SqlSugarClient GetInstance()
{ {
SqlSugarClient db = new SqlSugarClient(new SystemTablesConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer }); SqlSugarClient db = new SqlSugarClient(new SystemTableConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer });
db.Ado.IsEnableLogEvent = true; db.Ado.IsEnableLogEvent = true;
db.Ado.LogEventStarting = (sql, pars) => db.Ado.LogEventStarting = (sql, pars) =>
{ {

View File

@@ -87,7 +87,7 @@ namespace OrmTest.UnitTest
public SqlSugarClient GetInstance() public SqlSugarClient GetInstance()
{ {
SqlSugarClient db = new SqlSugarClient(new SystemTablesConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer }); SqlSugarClient db = new SqlSugarClient(new SystemTableConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer });
return db; return db;
} }
} }

View File

@@ -116,7 +116,7 @@ namespace OrmTest.UnitTest
public SqlSugarClient GetInstance() public SqlSugarClient GetInstance()
{ {
SqlSugarClient db = new SqlSugarClient(new SystemTablesConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer }); SqlSugarClient db = new SqlSugarClient(new SystemTableConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer });
return db; return db;
} }
} }

View File

@@ -29,7 +29,7 @@ namespace OrmTest.UnitTest
} }
public SqlSugarClient GetInstance() public SqlSugarClient GetInstance()
{ {
SqlSugarClient db = new SqlSugarClient(new SystemTablesConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer, IsAutoCloseConnection = true }); SqlSugarClient db = new SqlSugarClient(new SystemTableConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer, IsAutoCloseConnection = true });
return db; return db;
} }
} }

View File

@@ -11,7 +11,7 @@ namespace OrmTest.UnitTest
{ {
public SqlSugarClient GetInstance() public SqlSugarClient GetInstance()
{ {
SqlSugarClient db = new SqlSugarClient(new SystemTablesConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer }); SqlSugarClient db = new SqlSugarClient(new SystemTableConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer });
return db; return db;
} }
} }

View File

@@ -25,7 +25,7 @@ namespace OrmTest.UnitTest
} }
public SqlSugarClient GetInstance() public SqlSugarClient GetInstance()
{ {
SqlSugarClient db = new SqlSugarClient(new SystemTablesConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer, IsAutoCloseConnection = true }); SqlSugarClient db = new SqlSugarClient(new SystemTableConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer, IsAutoCloseConnection = true });
return db; return db;
} }
} }

View File

@@ -121,7 +121,7 @@ UNION ALL
public SqlSugarClient GetInstance() public SqlSugarClient GetInstance()
{ {
SqlSugarClient db = new SqlSugarClient(new SystemTablesConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer, IsAutoCloseConnection = true }); SqlSugarClient db = new SqlSugarClient(new SystemTableConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.SqlServer, IsAutoCloseConnection = true });
return db; return db;
} }
} }

View File

@@ -84,7 +84,7 @@ namespace SqlSugar
} }
private bool IsSystemTables() private bool IsSystemTables()
{ {
var isSystemTables = Context.CurrentConnectionConfig is SystemTablesConfig; var isSystemTables = Context.CurrentConnectionConfig is SystemTableConfig;
return isSystemTables; return isSystemTables;
} }
#endregion #endregion

View File

@@ -12,7 +12,7 @@ namespace SqlSugar
bool IsAutoCloseConnection { get; set; } bool IsAutoCloseConnection { get; set; }
} }
public class SystemTablesConfig : IConnectionConfig public class SystemTableConfig : IConnectionConfig
{ {
public string DbType { get; set; } public string DbType { get; set; }
public string ConnectionString { get; set; } public string ConnectionString { get; set; }

View File

@@ -20,7 +20,7 @@ namespace SqlSugar
{ {
get get
{ {
return this.CurrentConnectionConfig is SystemTablesConfig; return this.CurrentConnectionConfig is SystemTableConfig;
} }
} }
#endregion #endregion
@@ -30,7 +30,7 @@ namespace SqlSugar
/// If you have system table permissions, use this /// If you have system table permissions, use this
/// </summary> /// </summary>
/// <param name="config"></param> /// <param name="config"></param>
public SqlSugarClient(SystemTablesConfig config) public SqlSugarClient(SystemTableConfig config)
{ {
base.Context = this; base.Context = this;
base.CurrentConnectionConfig = config; base.CurrentConnectionConfig = config;
@@ -53,7 +53,7 @@ namespace SqlSugar
/// </summary> /// </summary>
/// <param name="masterConnectionConfig"></param> /// <param name="masterConnectionConfig"></param>
/// <param name="slaveConnectionConfigs"></param> /// <param name="slaveConnectionConfigs"></param>
public SqlSugarClient(SystemTablesConfig masterConnectionConfig, IConnectionConfig[] slaveConnectionConfigs) public SqlSugarClient(SystemTableConfig masterConnectionConfig, IConnectionConfig[] slaveConnectionConfigs)
{ {
base.Context = this; base.Context = this;
base.CurrentConnectionConfig = masterConnectionConfig; base.CurrentConnectionConfig = masterConnectionConfig;