mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-21 15:39:33 +08:00
Synchronization code
This commit is contained in:
parent
6334d9e8a5
commit
c0fd91c448
@ -25,7 +25,7 @@ namespace SqlSugar
|
|||||||
private MappingColumnList _MappingColumns;
|
private MappingColumnList _MappingColumns;
|
||||||
private IgnoreColumnList _IgnoreColumns;
|
private IgnoreColumnList _IgnoreColumns;
|
||||||
private IgnoreColumnList _IgnoreInsertColumns;
|
private IgnoreColumnList _IgnoreInsertColumns;
|
||||||
|
private Action<SqlSugarClient> _configAction;
|
||||||
|
|
||||||
internal Guid? AsyncId { get; set; }
|
internal Guid? AsyncId { get; set; }
|
||||||
internal bool? IsSingleInstance { get; set; }
|
internal bool? IsSingleInstance { get; set; }
|
||||||
@ -50,6 +50,7 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
public SqlSugarClient(ConnectionConfig config ,Action<SqlSugarClient> configAction)
|
public SqlSugarClient(ConnectionConfig config ,Action<SqlSugarClient> configAction)
|
||||||
{
|
{
|
||||||
|
_configAction=configAction;
|
||||||
Check.Exception(config == null, "ConnectionConfig config is null");
|
Check.Exception(config == null, "ConnectionConfig config is null");
|
||||||
InitContext(config);
|
InitContext(config);
|
||||||
configAction(this);
|
configAction(this);
|
||||||
@ -57,6 +58,7 @@ namespace SqlSugar
|
|||||||
|
|
||||||
public SqlSugarClient(List<ConnectionConfig> configs, Action<SqlSugarClient> configAction)
|
public SqlSugarClient(List<ConnectionConfig> configs, Action<SqlSugarClient> configAction)
|
||||||
{
|
{
|
||||||
|
_configAction = configAction;
|
||||||
Check.Exception(configs.IsNullOrEmpty(), "List<ConnectionConfig> configs is null or count=0");
|
Check.Exception(configs.IsNullOrEmpty(), "List<ConnectionConfig> configs is null or count=0");
|
||||||
InitConfigs(configs);
|
InitConfigs(configs);
|
||||||
var config = configs.First();
|
var config = configs.First();
|
||||||
@ -1240,7 +1242,11 @@ namespace SqlSugar
|
|||||||
}
|
}
|
||||||
public SqlSugarClient CopyNew()
|
public SqlSugarClient CopyNew()
|
||||||
{
|
{
|
||||||
var result= new SqlSugarClient(UtilMethods.CopyConfig(this.Ado.Context.CurrentConnectionConfig));
|
SqlSugarClient result;
|
||||||
|
if(_configAction!=null)
|
||||||
|
result=new SqlSugarClient(UtilMethods.CopyConfig(this.Ado.Context.CurrentConnectionConfig),_configAction);
|
||||||
|
else
|
||||||
|
result = new SqlSugarClient(UtilMethods.CopyConfig(this.Ado.Context.CurrentConnectionConfig));
|
||||||
result.QueryFilter = this.QueryFilter;
|
result.QueryFilter = this.QueryFilter;
|
||||||
if (_AllClients != null)
|
if (_AllClients != null)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user