This commit is contained in:
sunkaixuan
2017-09-04 16:37:20 +08:00
parent f4d9290b7d
commit 751afe87f7
2 changed files with 9 additions and 4 deletions

View File

@@ -865,10 +865,7 @@ namespace SqlSugar
var contextProperty = item.GetType().GetProperty("Context");
ConnectionConfig config = new ConnectionConfig();
config = this.Context.CurrentConnectionConfig;
var newClient = new SqlSugarClient(config);
newClient.MappingColumns = this.Context.MappingColumns;
newClient.MappingTables = this.Context.MappingTables;
newClient.IgnoreColumns = this.Context.IgnoreColumns;
SqlSugarClient newClient = this.Context.CopyContext(config);
contextProperty.SetValue(item, newClient, null);
}
}

View File

@@ -565,6 +565,14 @@ namespace SqlSugar
this.Ado.Dispose();
}
}
internal SqlSugarClient CopyContext(ConnectionConfig config)
{
var newClient = new SqlSugarClient(config);
newClient.MappingColumns = this.Context.MappingColumns;
newClient.MappingTables = this.Context.MappingTables;
newClient.IgnoreColumns = this.Context.IgnoreColumns;
return newClient;
}
#endregion
}
}