mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2026-01-22 02:51:58 +08:00
Add new SqlSugarClient+2
This commit is contained in:
@@ -48,7 +48,23 @@ namespace SqlSugar
|
||||
_AllClients = configs.Select(it => new SugarTenant() { ConnectionConfig = it }).ToList(); ;
|
||||
_AllClients.First(it => it.ConnectionConfig.ConfigId == config.ConfigId).Context = this.Context;
|
||||
}
|
||||
public SqlSugarClient(ConnectionConfig config ,Action<SqlSugarClient> configAction)
|
||||
{
|
||||
Check.Exception(config == null, "ConnectionConfig config is null");
|
||||
InitContext(config);
|
||||
configAction(this);
|
||||
}
|
||||
|
||||
public SqlSugarClient(List<ConnectionConfig> configs, Action<SqlSugarClient> configAction)
|
||||
{
|
||||
Check.Exception(configs.IsNullOrEmpty(), "List<ConnectionConfig> configs is null or count=0");
|
||||
InitConfigs(configs);
|
||||
var config = configs.First();
|
||||
InitContext(config);
|
||||
_AllClients = configs.Select(it => new SugarTenant() { ConnectionConfig = it }).ToList(); ;
|
||||
_AllClients.First(it => it.ConnectionConfig.ConfigId == config.ConfigId).Context = this.Context;
|
||||
configAction(this);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Global variable
|
||||
|
||||
@@ -48,7 +48,23 @@ namespace SqlSugar
|
||||
_AllClients = configs.Select(it => new SugarTenant() { ConnectionConfig = it }).ToList(); ;
|
||||
_AllClients.First(it => it.ConnectionConfig.ConfigId == config.ConfigId).Context = this.Context;
|
||||
}
|
||||
public SqlSugarClient(ConnectionConfig config ,Action<SqlSugarClient> configAction)
|
||||
{
|
||||
Check.Exception(config == null, "ConnectionConfig config is null");
|
||||
InitContext(config);
|
||||
configAction(this);
|
||||
}
|
||||
|
||||
public SqlSugarClient(List<ConnectionConfig> configs, Action<SqlSugarClient> configAction)
|
||||
{
|
||||
Check.Exception(configs.IsNullOrEmpty(), "List<ConnectionConfig> configs is null or count=0");
|
||||
InitConfigs(configs);
|
||||
var config = configs.First();
|
||||
InitContext(config);
|
||||
_AllClients = configs.Select(it => new SugarTenant() { ConnectionConfig = it }).ToList(); ;
|
||||
_AllClients.First(it => it.ConnectionConfig.ConfigId == config.ConfigId).Context = this.Context;
|
||||
configAction(this);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Global variable
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0"?>
|
||||
<package >
|
||||
<metadata>
|
||||
<id>SqlSugarCore</id>
|
||||
<version>5.1.3.23</version>
|
||||
<id>SqlSugarCore-preview02</id>
|
||||
<version>5.1.3.24</version>
|
||||
<authors>sunkaixuan</authors>
|
||||
<owners>果糖大数据科技</owners>
|
||||
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>
|
||||
|
||||
Reference in New Issue
Block a user