Example #1
0
        public RedisCacheStackExchange()
        {
            if (Configuration == null)
            {
                this.Configuration = Container.Resolve <IWebConfiguration>();
            }
            var redisConfig = this.Configuration.GetSection <RedisConfigSection>("redis");

            if (redisConfig == null)
            {
                return;
            }
            var cacheStrings = redisConfig.GetCacheStrings();
            var cacheString  = cacheStrings.FirstOrDefault();

            this.connectionName = cacheString.Name;
            DefaultRedisActivator.InitializeStackExchange();
            this.Database = Container.Resolve <StackExchange.Redis.IDatabase>();
        }
Example #2
0
 public RedisCacheServiceStack()
 {
     DefaultRedisActivator.InitializeServiceStack();
 }