예제 #1
0
        public static IServiceCollection ConfigureRedisCache(this IServiceCollection services, Action <RedisCacheOptions> redisCacheSetupAction)
        {
            var redisCacheOptions = new RedisCacheOptions();

            redisCacheSetupAction.Invoke(redisCacheOptions);
            services.AddSingleton(factory => redisCacheOptions);
            services.AddSingleton <IRedisCacheMaintenance, RedisCacheMaintenance>();

            return(services);
        }
예제 #2
0
 public RedisCacheMaintenance(RedisCacheOptions options)
 {
     _options = options;
 }