mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2026-01-23 13:21:59 +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 = configs.Select(it => new SugarTenant() { ConnectionConfig = it }).ToList(); ;
|
||||||
_AllClients.First(it => it.ConnectionConfig.ConfigId == config.ConfigId).Context = this.Context;
|
_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
|
#endregion
|
||||||
|
|
||||||
#region Global variable
|
#region Global variable
|
||||||
|
|||||||
@@ -48,7 +48,23 @@ namespace SqlSugar
|
|||||||
_AllClients = configs.Select(it => new SugarTenant() { ConnectionConfig = it }).ToList(); ;
|
_AllClients = configs.Select(it => new SugarTenant() { ConnectionConfig = it }).ToList(); ;
|
||||||
_AllClients.First(it => it.ConnectionConfig.ConfigId == config.ConfigId).Context = this.Context;
|
_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
|
#endregion
|
||||||
|
|
||||||
#region Global variable
|
#region Global variable
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<package >
|
<package >
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>SqlSugarCore</id>
|
<id>SqlSugarCore-preview02</id>
|
||||||
<version>5.1.3.23</version>
|
<version>5.1.3.24</version>
|
||||||
<authors>sunkaixuan</authors>
|
<authors>sunkaixuan</authors>
|
||||||
<owners>果糖大数据科技</owners>
|
<owners>果糖大数据科技</owners>
|
||||||
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>
|
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>
|
||||||
|
|||||||
Reference in New Issue
Block a user