Browse Source

Async Cache BUG

pull/12/MERGE
610262374@qq.com 6 years ago
parent
commit
2d842667d0
  1. 2
      Src/Asp.Net/ExtensionsDemo/Config.cs
  2. 2
      Src/Asp.Net/SqlSugar/Abstract/QueryableProvider/QueryableProvider.cs
  3. 1
      Src/Asp.Net/SqlSugar/Infrastructure/ContextMethods.cs

2
Src/Asp.Net/ExtensionsDemo/Config.cs

@ -8,6 +8,6 @@ namespace ExtensionsDemo
{
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";
}
}

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

@ -1269,7 +1269,7 @@ namespace SqlSugar
var asyncContext = this.Context.Utilities.CopyContext(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;
asyncQueryableBuilder.Take = this.QueryBuilder.Take;
asyncQueryableBuilder.Skip = this.QueryBuilder.Skip;

1
Src/Asp.Net/SqlSugar/Infrastructure/ContextMethods.cs

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

Loading…
Cancel
Save