Browse Source

-

pull/12/MERGE
sunkaixuan 7 years ago
parent
commit
751afe87f7
  1. 5
      Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs
  2. 8
      Src/Asp.Net/SqlSugar/SqlSugarClient.cs

5
Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs

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

8
Src/Asp.Net/SqlSugar/SqlSugarClient.cs

@ -565,6 +565,14 @@ namespace SqlSugar
this.Ado.Dispose(); 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 #endregion
} }
} }

Loading…
Cancel
Save