mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-24 07:22:57 +08:00
Upate Core
This commit is contained in:
parent
d089e8950c
commit
e7a4bc4945
@ -538,15 +538,18 @@ namespace SqlSugar
|
|||||||
#region TenantManager
|
#region TenantManager
|
||||||
public void ChangeDatabase(string configId)
|
public void ChangeDatabase(string configId)
|
||||||
{
|
{
|
||||||
|
var isLog = _Context.Ado.IsEnableLogEvent;
|
||||||
Check.Exception(!_AllClients.Any(it => it.ConnectionConfig.ConfigId == configId), "ConfigId was not found {0}", configId);
|
Check.Exception(!_AllClients.Any(it => it.ConnectionConfig.ConfigId == configId), "ConfigId was not found {0}", configId);
|
||||||
InitTenant(_AllClients.First(it => it.ConnectionConfig.ConfigId == configId));
|
InitTenant(_AllClients.First(it => it.ConnectionConfig.ConfigId == configId));
|
||||||
if (this._IsAllTran)
|
if (this._IsAllTran)
|
||||||
this.Ado.BeginTran();
|
this.Ado.BeginTran();
|
||||||
if (this._IsOpen)
|
if (this._IsOpen)
|
||||||
this.Open();
|
this.Open();
|
||||||
|
_Context.Ado.IsEnableLogEvent = isLog;
|
||||||
}
|
}
|
||||||
public void ChangeDatabase(Func<ConnectionConfig, bool> changeExpression)
|
public void ChangeDatabase(Func<ConnectionConfig, bool> changeExpression)
|
||||||
{
|
{
|
||||||
|
var isLog = _Context.Ado.IsEnableLogEvent;
|
||||||
var allConfigs = _AllClients.Select(it => it.ConnectionConfig);
|
var allConfigs = _AllClients.Select(it => it.ConnectionConfig);
|
||||||
Check.Exception(!allConfigs.Any(changeExpression), "changeExpression was not found {0}", changeExpression.ToString());
|
Check.Exception(!allConfigs.Any(changeExpression), "changeExpression was not found {0}", changeExpression.ToString());
|
||||||
InitTenant(_AllClients.First(it => it.ConnectionConfig == allConfigs.First(changeExpression)));
|
InitTenant(_AllClients.First(it => it.ConnectionConfig == allConfigs.First(changeExpression)));
|
||||||
@ -554,6 +557,7 @@ namespace SqlSugar
|
|||||||
this.Ado.BeginTran();
|
this.Ado.BeginTran();
|
||||||
if (this._IsOpen)
|
if (this._IsOpen)
|
||||||
this.Open();
|
this.Open();
|
||||||
|
_Context.Ado.IsEnableLogEvent = isLog;
|
||||||
}
|
}
|
||||||
public void BeginTran()
|
public void BeginTran()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user