CacheOptions to AbpCacheOptions

pull/1919/head
Yunus Emre Kalkan 6 years ago
parent b1e594d622
commit e19dc65af5

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

@ -4,7 +4,7 @@ using System.Collections.Generic;
namespace Volo.Abp.Caching
{
public class CacheOptions
public class AbpCacheOptions
{
/// <summary>
/// Cache key prefix.
@ -22,7 +22,7 @@ namespace Volo.Abp.Caching
/// </summary>
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>>();
GlobalCacheEntryOptions = new DistributedCacheEntryOptions();

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

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

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save