Browse Source

-

pull/12/MERGE
sunkaixuan 7 years ago
parent
commit
39fd186c29
  1. 2
      Src/Asp.Net/SqlSugar/Abstract/DeleteProvider/DeleteableProvider.cs
  2. 2
      Src/Asp.Net/SqlSugar/Abstract/InsertableProvider/InsertableProvider.cs
  3. 4
      Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs
  4. 2
      Src/Asp.Net/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs
  5. 2
      Src/Asp.Net/SqlSugar/Infrastructure/RewritableMethods.cs
  6. 2
      Src/Asp.Net/SqlSugar/Interface/IRewritableMethods.cs

2
Src/Asp.Net/SqlSugar/Abstract/DeleteProvider/DeleteableProvider.cs

@ -249,7 +249,7 @@ namespace SqlSugar
}
private IDeleteable<T> CopyDeleteable() {
var asyncContext = this.Context.Utilities.CopyCurrentContext(this.Context,true);
var asyncContext = this.Context.Utilities.CopyContext(this.Context,true);
asyncContext.CurrentConnectionConfig.IsAutoCloseConnection = true;
var asyncDeleteable = asyncContext.Deleteable<T>();

2
Src/Asp.Net/SqlSugar/Abstract/InsertableProvider/InsertableProvider.cs

@ -307,7 +307,7 @@ namespace SqlSugar
}
private IInsertable<T> CopyInsertable()
{
var asyncContext = this.Context.Utilities.CopyCurrentContext(this.Context,true);
var asyncContext = this.Context.Utilities.CopyContext(this.Context,true);
asyncContext.CurrentConnectionConfig.IsAutoCloseConnection = true;
var asyncInsertable = asyncContext.Insertable<T>(this.InsertObjs);

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

@ -1024,7 +1024,7 @@ namespace SqlSugar
foreach (var item in result)
{
var contextProperty = item.GetType().GetProperty("Context");
SqlSugarClient newClient = this.Context.Utilities.CopyCurrentContext(this.Context);
SqlSugarClient newClient = this.Context.Utilities.CopyContext(this.Context);
contextProperty.SetValue(item, newClient, null);
}
}
@ -1032,7 +1032,7 @@ namespace SqlSugar
}
private ISugarQueryable<T> CopyQueryable()
{
var asyncContext = this.Context.Utilities.CopyCurrentContext(this.Context,true);
var asyncContext = this.Context.Utilities.CopyContext(this.Context,true);
asyncContext.CurrentConnectionConfig.IsAutoCloseConnection = true;
var asyncQueryable = asyncContext.Queryable<ExpandoObject>().Select<T>(string.Empty);

2
Src/Asp.Net/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs

@ -311,7 +311,7 @@ namespace SqlSugar
}
private IUpdateable<T> CopyUpdateable()
{
var asyncContext = this.Context.Utilities.CopyCurrentContext(this.Context,true);
var asyncContext = this.Context.Utilities.CopyContext(this.Context,true);
asyncContext.CurrentConnectionConfig.IsAutoCloseConnection = true;
var asyncUpdateable = asyncContext.Updateable<T>(this.UpdateObjs);

2
Src/Asp.Net/SqlSugar/Infrastructure/RewritableMethods.cs

@ -222,7 +222,7 @@ namespace SqlSugar
return DeserializeObject<T>(jsonString);
}
}
public SqlSugarClient CopyCurrentContext(SqlSugarClient context,bool isCopyEvents=false)
public SqlSugarClient CopyContext(SqlSugarClient context,bool isCopyEvents=false)
{
var newClient = new SqlSugarClient(this.TranslateCopy(context.CurrentConnectionConfig));
newClient.MappingColumns = this.TranslateCopy(context.MappingColumns);

2
Src/Asp.Net/SqlSugar/Interface/IRewritableMethods.cs

@ -16,7 +16,7 @@ namespace SqlSugar
string SerializeObject(object value);
T DeserializeObject<T>(string value);
T TranslateCopy<T>(T sourceObject);
SqlSugarClient CopyCurrentContext(SqlSugarClient context, bool isCopyEvents = false);
SqlSugarClient CopyContext(SqlSugarClient context, bool isCopyEvents = false);
dynamic DataTableToDynamic(DataTable table);
ICacheManager<T> GetCacheInstance<T>();
void RemoveCacheAll();

Loading…
Cancel
Save