コード例 #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;
 }