Beispiel #1
0
 public static void AddRedisCaching(this IServiceCollection services, RedisConfiguration redisConfiguration)
 {
     services.AddSingleton <IDistributedCacheService>(
         CacheBuilder.Builder()
         .WithRedisConfiguration(redisConfiguration)
         .BuildDistributedCache()
         );
 }
Beispiel #2
0
        public static void AddRedisCaching(this IServiceCollection services, IConfiguration configuration)
        {
            var redisConfig = new RedisConfiguration();
            var redisConfigurationSection = configuration.GetSection("JediCacheSettings:RedisConfiguration");

            redisConfigurationSection.Bind(redisConfig);

            services.AddSingleton <IDistributedCacheService>(
                CacheBuilder.Builder()
                .WithRedisConfiguration(redisConfig)
                .BuildDistributedCache()
                );
        }