Async Cache BUG

This commit is contained in:
610262374@qq.com 2018-11-08 14:27:56 +08:00
parent 980e22b201
commit 2d842667d0
3 changed files with 3 additions and 2 deletions

View File

@ -8,6 +8,6 @@ namespace ExtensionsDemo
{ {
public class Config public class Config
{ {
public static string ConnectionString = "server=.;uid=sa;pwd=sasa;database=SqlSugar4XTest"; public static string ConnectionString = "server=.;uid=sa;pwd=@jhl85661501;database=SqlSugar4XTest";
} }
} }

View File

@ -1269,7 +1269,7 @@ namespace SqlSugar
var asyncContext = this.Context.Utilities.CopyContext(true); var asyncContext = this.Context.Utilities.CopyContext(true);
asyncContext.CurrentConnectionConfig.IsAutoCloseConnection = true; asyncContext.CurrentConnectionConfig.IsAutoCloseConnection = true;
var asyncQueryable = asyncContext.Queryable<ExpandoObject>().Select<T>(string.Empty); var asyncQueryable = asyncContext.Queryable<ExpandoObject>().Select<T>(string.Empty).WithCacheIF(IsCache, CacheTime);
var asyncQueryableBuilder = asyncQueryable.QueryBuilder; var asyncQueryableBuilder = asyncQueryable.QueryBuilder;
asyncQueryableBuilder.Take = this.QueryBuilder.Take; asyncQueryableBuilder.Take = this.QueryBuilder.Take;
asyncQueryableBuilder.Skip = this.QueryBuilder.Skip; asyncQueryableBuilder.Skip = this.QueryBuilder.Skip;

View File

@ -269,6 +269,7 @@ namespace SqlSugar
public SqlSugarClient CopyContext(bool isCopyEvents = false) public SqlSugarClient CopyContext(bool isCopyEvents = false)
{ {
var newClient = new SqlSugarClient(this.TranslateCopy(Context.CurrentConnectionConfig)); var newClient = new SqlSugarClient(this.TranslateCopy(Context.CurrentConnectionConfig));
newClient.CurrentConnectionConfig.ConfigureExternalServices=Context.CurrentConnectionConfig.ConfigureExternalServices;
newClient.MappingColumns = this.TranslateCopy(Context.MappingColumns); newClient.MappingColumns = this.TranslateCopy(Context.MappingColumns);
newClient.MappingTables = this.TranslateCopy(Context.MappingTables); newClient.MappingTables = this.TranslateCopy(Context.MappingTables);
newClient.IgnoreColumns = this.TranslateCopy(Context.IgnoreColumns); newClient.IgnoreColumns = this.TranslateCopy(Context.IgnoreColumns);