dotnetcore / EasyCaching

:boom: EasyCaching is an open source caching library that contains basic usages and some advanced usages of caching which can help us to handle caching more easier!
MIT License
1.95k stars 322 forks source link

RedisCache configure code-only configuration for StackExchange.Redis #452

Closed Memoyu closed 1 year ago

Memoyu commented 1 year ago

Content:

RedisCache support configure code-only configuration

Usage:

var redisConfig = ConfigurationOptions.Parse("127.0.0.1:6380");
redisConfig.DefaultDatabase = 8;
services.AddEasyCaching(x =>
     x.UseRedis(options =>
     {
         options.DBConfig.ConfigurationOptions = redisConfig;
     }, ProviderName).UseRedisLock().WithJson(ProviderName));