Esempio n. 1
0
        /// <summary>
        /// 集成注入方式
        /// </summary>
        /// <param name="services"></param>
        /// <param name="options"></param>
        /// <returns></returns>
        public IServiceCollection Config(IServiceCollection services, CacheOptions options)
        {
            var redisHelper = new RedisCacheHelper(options.Redis);

            services.AddSingleton(redisHelper);
            services.AddSingleton <ICacheHandler, RedisCacheHandler>();
            return(services);
        }
Esempio n. 2
0
 public RedisCacheHandler(RedisCacheHelper helper)
 {
     _helper = helper;
 }