Example #1
0
        public RedisCache(ISerializer serializer, IRedisWrapper redisWrapper = null)
        {
            GuardHelper.ArgumentNotNull(() => serializer);
            if (redisWrapper == null)
            {
                redisWrapper = RedisWrapperFactory.GetRedisWrapper();
            }

            this.serializer   = serializer;
            this.redisWrapper = redisWrapper;
        }
 /// <summary>
 /// Helper method which uses the RedisConnectionConfig properties to get the correct RedisConnectionWrapper
 ///     given an HttpContext
 /// </summary>
 /// <param name="context">The httpcontext of the current request</param>
 /// <returns>
 /// A RedisConnectionWrapper object which can be used to get an StackExchange.Redis IDatabase instance
 ///     for communicating with Redis
 /// </returns>
 public static IRedisWrapper RedisConnWrapper()
 {
     return(RedisWrapperFactory.GetRedisWrapper());
 }