mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 10:08:19 +08:00
-
This commit is contained in:
@@ -32,7 +32,7 @@ namespace OrmTest.Demo
|
||||
|
||||
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.LogEventStarting = (sql, pars) =>
|
||||
{
|
||||
|
@@ -53,7 +53,7 @@ namespace OrmTest.Demo
|
||||
|
||||
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.LogEventStarting = (sql, pars) =>
|
||||
{
|
||||
|
@@ -186,7 +186,7 @@ namespace OrmTest.Demo
|
||||
|
||||
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.LogEventStarting = (sql, pars) =>
|
||||
{
|
||||
|
@@ -47,7 +47,7 @@ namespace OrmTest.Demo
|
||||
}
|
||||
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.LogEventStarting = (sql, pars) =>
|
||||
{
|
||||
|
@@ -16,7 +16,7 @@ namespace OrmTest.PerformanceTesting
|
||||
}
|
||||
public void Select()
|
||||
{
|
||||
SqlSugarClient db = new SqlSugarClient(new SystemTablesConfig()
|
||||
SqlSugarClient db = new SqlSugarClient(new SystemTableConfig()
|
||||
{
|
||||
ConnectionString = Config.ConnectionString,
|
||||
DbType = DbType.SqlServer,
|
||||
|
@@ -55,7 +55,7 @@ namespace OrmTest
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@@ -118,7 +118,7 @@ INSERT INTO [Student]
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@@ -71,7 +71,7 @@ namespace OrmTest.UnitTest
|
||||
|
||||
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.LogEventStarting = (sql, pars) =>
|
||||
{
|
||||
|
@@ -87,7 +87,7 @@ namespace OrmTest.UnitTest
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@@ -116,7 +116,7 @@ namespace OrmTest.UnitTest
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@@ -29,7 +29,7 @@ namespace OrmTest.UnitTest
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@@ -11,7 +11,7 @@ namespace OrmTest.UnitTest
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@@ -25,7 +25,7 @@ namespace OrmTest.UnitTest
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@@ -121,7 +121,7 @@ UNION ALL
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@@ -84,7 +84,7 @@ namespace SqlSugar
|
||||
}
|
||||
private bool IsSystemTables()
|
||||
{
|
||||
var isSystemTables = Context.CurrentConnectionConfig is SystemTablesConfig;
|
||||
var isSystemTables = Context.CurrentConnectionConfig is SystemTableConfig;
|
||||
return isSystemTables;
|
||||
}
|
||||
#endregion
|
||||
|
@@ -12,7 +12,7 @@ namespace SqlSugar
|
||||
bool IsAutoCloseConnection { get; set; }
|
||||
}
|
||||
|
||||
public class SystemTablesConfig : IConnectionConfig
|
||||
public class SystemTableConfig : IConnectionConfig
|
||||
{
|
||||
public string DbType { get; set; }
|
||||
public string ConnectionString { get; set; }
|
||||
|
@@ -20,7 +20,7 @@ namespace SqlSugar
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.CurrentConnectionConfig is SystemTablesConfig;
|
||||
return this.CurrentConnectionConfig is SystemTableConfig;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -30,7 +30,7 @@ namespace SqlSugar
|
||||
/// If you have system table permissions, use this
|
||||
/// </summary>
|
||||
/// <param name="config"></param>
|
||||
public SqlSugarClient(SystemTablesConfig config)
|
||||
public SqlSugarClient(SystemTableConfig config)
|
||||
{
|
||||
base.Context = this;
|
||||
base.CurrentConnectionConfig = config;
|
||||
@@ -53,7 +53,7 @@ namespace SqlSugar
|
||||
/// </summary>
|
||||
/// <param name="masterConnectionConfig"></param>
|
||||
/// <param name="slaveConnectionConfigs"></param>
|
||||
public SqlSugarClient(SystemTablesConfig masterConnectionConfig, IConnectionConfig[] slaveConnectionConfigs)
|
||||
public SqlSugarClient(SystemTableConfig masterConnectionConfig, IConnectionConfig[] slaveConnectionConfigs)
|
||||
{
|
||||
base.Context = this;
|
||||
base.CurrentConnectionConfig = masterConnectionConfig;
|
||||
|
Reference in New Issue
Block a user