Browse Source

CacheOptions to AbpCacheOptions

pull/1919/head
Yunus Emre Kalkan 7 years ago
parent
commit
e19dc65af5
  1. 2
      framework/src/Volo.Abp.Caching/Volo/Abp/Caching/AbpCachingModule.cs
  2. 4
      framework/src/Volo.Abp.Caching/Volo/Abp/Caching/CacheOptions.cs
  3. 4
      framework/src/Volo.Abp.Caching/Volo/Abp/Caching/DistributedCache.cs
  4. 2
      framework/test/Volo.Abp.Caching.Tests/Volo/Abp/Caching/AbpCachingTestModule.cs
  5. 4
      framework/test/Volo.Abp.Caching.Tests/Volo/Abp/Caching/DistributedCache_ConfigureOptions_Test.cs
  6. 2
      samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.HttpApi.Host/BookManagementHttpApiHostModule.cs
  7. 2
      samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/BookManagementIdentityServerModule.cs
  8. 2
      samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Host/BookManagementWebHostModule.cs
  9. 2
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs
  10. 2
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs
  11. 2
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebModule.cs
  12. 2
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs
  13. 2
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs
  14. 2
      templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebHostModule.cs

2
framework/src/Volo.Abp.Caching/Volo/Abp/Caching/AbpCachingModule.cs

@ -22,7 +22,7 @@ namespace Volo.Abp.Caching
context.Services.AddSingleton(typeof(IDistributedCache<>), typeof(DistributedCache<>)); context.Services.AddSingleton(typeof(IDistributedCache<>), typeof(DistributedCache<>));
context.Services.Configure<CacheOptions>(cacheOptions => context.Services.Configure<AbpCacheOptions>(cacheOptions =>
{ {
cacheOptions.GlobalCacheEntryOptions.SlidingExpiration = TimeSpan.FromMinutes(20); cacheOptions.GlobalCacheEntryOptions.SlidingExpiration = TimeSpan.FromMinutes(20);
}); });

4
framework/src/Volo.Abp.Caching/Volo/Abp/Caching/CacheOptions.cs

@ -4,7 +4,7 @@ using System.Collections.Generic;
namespace Volo.Abp.Caching namespace Volo.Abp.Caching
{ {
public class CacheOptions public class AbpCacheOptions
{ {
/// <summary> /// <summary>
/// Cache key prefix. /// Cache key prefix.
@ -22,7 +22,7 @@ namespace Volo.Abp.Caching
/// </summary> /// </summary>
public List<Func<string, DistributedCacheEntryOptions>> CacheConfigurators { get; set; } //TODO list item use a configurator interface instead? public List<Func<string, DistributedCacheEntryOptions>> CacheConfigurators { get; set; } //TODO list item use a configurator interface instead?
public CacheOptions() public AbpCacheOptions()
{ {
CacheConfigurators = new List<Func<string, DistributedCacheEntryOptions>>(); CacheConfigurators = new List<Func<string, DistributedCacheEntryOptions>>();
GlobalCacheEntryOptions = new DistributedCacheEntryOptions(); GlobalCacheEntryOptions = new DistributedCacheEntryOptions();

4
framework/src/Volo.Abp.Caching/Volo/Abp/Caching/DistributedCache.cs

@ -36,12 +36,12 @@ namespace Volo.Abp.Caching
protected DistributedCacheEntryOptions DefaultCacheOptions; protected DistributedCacheEntryOptions DefaultCacheOptions;
private readonly CacheOptions _cacheOption; private readonly AbpCacheOptions _cacheOption;
private readonly DistributedCacheOptions _distributedCacheOption; private readonly DistributedCacheOptions _distributedCacheOption;
public DistributedCache( public DistributedCache(
IOptions<CacheOptions> cacheOption, IOptions<AbpCacheOptions> cacheOption,
IOptions<DistributedCacheOptions> distributedCacheOption, IOptions<DistributedCacheOptions> distributedCacheOption,
IDistributedCache cache, IDistributedCache cache,
ICancellationTokenProvider cancellationTokenProvider, ICancellationTokenProvider cancellationTokenProvider,

2
framework/test/Volo.Abp.Caching.Tests/Volo/Abp/Caching/AbpCachingTestModule.cs

@ -9,7 +9,7 @@ namespace Volo.Abp.Caching
{ {
public override void ConfigureServices(ServiceConfigurationContext context) public override void ConfigureServices(ServiceConfigurationContext context)
{ {
Configure<CacheOptions>(option => Configure<AbpCacheOptions>(option =>
{ {
option.CacheConfigurators.Add(cacheName => option.CacheConfigurators.Add(cacheName =>
{ {

4
framework/test/Volo.Abp.Caching.Tests/Volo/Abp/Caching/DistributedCache_ConfigureOptions_Test.cs

@ -10,7 +10,7 @@ namespace Volo.Abp.Caching
public class DistributedCache_ConfigureOptions_Test : AbpIntegratedTest<AbpCachingTestModule> public class DistributedCache_ConfigureOptions_Test : AbpIntegratedTest<AbpCachingTestModule>
{ {
[Fact] [Fact]
public void Configure_CacheOptions() public void Configure_AbpCacheOptions()
{ {
var personCache = GetRequiredService<IDistributedCache<Sail.Testing.Caching.PersonCacheItem>>(); var personCache = GetRequiredService<IDistributedCache<Sail.Testing.Caching.PersonCacheItem>>();
GetDefaultCachingOptions(personCache).SlidingExpiration.ShouldBeNull(); GetDefaultCachingOptions(personCache).SlidingExpiration.ShouldBeNull();
@ -18,7 +18,7 @@ namespace Volo.Abp.Caching
} }
[Fact] [Fact]
public async Task Default_CacheOptions_Should_Be_20_Mins() public async Task Default_AbpCacheOptions_Should_Be_20_Mins()
{ {
var personCache = GetRequiredService<IDistributedCache<PersonCacheItem>>(); var personCache = GetRequiredService<IDistributedCache<PersonCacheItem>>();

2
samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.HttpApi.Host/BookManagementHttpApiHostModule.cs

@ -88,7 +88,7 @@ namespace Acme.BookStore.BookManagement
options.ApiName = "BookManagement"; options.ApiName = "BookManagement";
}); });
Configure<CacheOptions>(options => Configure<AbpCacheOptions>(options =>
{ {
options.KeyPrefix = "BookManagement:"; options.KeyPrefix = "BookManagement:";
}); });

2
samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.IdentityServer/BookManagementIdentityServerModule.cs

@ -107,7 +107,7 @@ namespace Acme.BookStore.BookManagement
options.ApiName = configuration["AuthServer:ApiName"]; options.ApiName = configuration["AuthServer:ApiName"];
}); });
Configure<CacheOptions>(options => Configure<AbpCacheOptions>(options =>
{ {
options.KeyPrefix = "BookManagement:"; options.KeyPrefix = "BookManagement:";
}); });

2
samples/BookStore-Modular/modules/book-management/host/Acme.BookStore.BookManagement.Web.Host/BookManagementWebHostModule.cs

@ -86,7 +86,7 @@ namespace Acme.BookStore.BookManagement
private void ConfigureCache(IConfigurationRoot configuration) private void ConfigureCache(IConfigurationRoot configuration)
{ {
Configure<CacheOptions>(options => Configure<AbpCacheOptions>(options =>
{ {
options.KeyPrefix = "BookManagement:"; options.KeyPrefix = "BookManagement:";
}); });

2
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs

@ -55,7 +55,7 @@ namespace MyCompanyName.MyProjectName
private void ConfigureCache(IConfigurationRoot configuration) private void ConfigureCache(IConfigurationRoot configuration)
{ {
Configure<CacheOptions>(options => Configure<AbpCacheOptions>(options =>
{ {
options.KeyPrefix = "MyProjectName:"; options.KeyPrefix = "MyProjectName:";
}); });

2
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs

@ -94,7 +94,7 @@ namespace MyCompanyName.MyProjectName
options.IsJobExecutionEnabled = false; options.IsJobExecutionEnabled = false;
}); });
Configure<CacheOptions>(options => Configure<AbpCacheOptions>(options =>
{ {
options.KeyPrefix = "MyProjectName:"; options.KeyPrefix = "MyProjectName:";
}); });

2
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebModule.cs

@ -85,7 +85,7 @@ namespace MyCompanyName.MyProjectName.Web
private void ConfigureCache(IConfigurationRoot configuration) private void ConfigureCache(IConfigurationRoot configuration)
{ {
Configure<CacheOptions>(options => Configure<AbpCacheOptions>(options =>
{ {
options.KeyPrefix = "MyProjectName:"; options.KeyPrefix = "MyProjectName:";
}); });

2
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.HttpApi.Host/MyProjectNameHttpApiHostModule.cs

@ -87,7 +87,7 @@ namespace MyCompanyName.MyProjectName
options.ApiName = "MyProjectName"; options.ApiName = "MyProjectName";
}); });
Configure<CacheOptions>(options => Configure<AbpCacheOptions>(options =>
{ {
options.KeyPrefix = "MyProjectName:"; options.KeyPrefix = "MyProjectName:";
}); });

2
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.IdentityServer/MyProjectNameIdentityServerModule.cs

@ -107,7 +107,7 @@ namespace MyCompanyName.MyProjectName
options.ApiName = configuration["AuthServer:ApiName"]; options.ApiName = configuration["AuthServer:ApiName"];
}); });
Configure<CacheOptions>(options => Configure<AbpCacheOptions>(options =>
{ {
options.KeyPrefix = "MyProjectName:"; options.KeyPrefix = "MyProjectName:";
}); });

2
templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host/MyProjectNameWebHostModule.cs

@ -86,7 +86,7 @@ namespace MyCompanyName.MyProjectName
private void ConfigureCache(IConfigurationRoot configuration) private void ConfigureCache(IConfigurationRoot configuration)
{ {
Configure<CacheOptions>(options => Configure<AbpCacheOptions>(options =>
{ {
options.KeyPrefix = "MyProjectName:"; options.KeyPrefix = "MyProjectName:";
}); });

Loading…
Cancel
Save