Example #1
0
        public RedisCacheManager(ICacheManager perRequestCacheManager,
                                 IRedisConnectionWrapper connectionWrapper,
                                 CachingConfig config)
        {
            if (string.IsNullOrEmpty(config.RedisCachingConnectionString))
            {
                throw new Exception("Redis connection string is empty");
            }

            this._perRequestCacheManager = perRequestCacheManager;

            // ConnectionMultiplexer.Connect should only be called once and shared between callers
            this._connectionWrapper = connectionWrapper;

            this._db = _connectionWrapper.GetDatabase();
        }
Example #2
0
 public RedisConnectionWrapper(CachingConfig config)
 {
     this._config           = config;
     this._connectionString = new Lazy <string>(GetConnectionString);
     this._redisLockFactory = CreateRedisLockFactory();
 }