Beispiel #1
0
        public StackExchangeRedisFactory(string redisConfigName)
        {
            var configuration = RedisConfigurationHandler.GetConfig(redisConfigName);

            if (configuration == null)
            {
                var msg = "Unable to locate <redisConfig> section into your configuration file.";
                throw new ConfigurationErrorsException(msg);
            }
            this.redisConfigName    = redisConfigName;
            this.redisConfiguration = configuration;
        }
        public StackExchangeRedisFactory(IRedisConfiguration configuration = null)
        {
            if (configuration == null)
            {
                configuration = RedisConfigurationHandler.GetConfig();
            }

            if (configuration == null)
            {
                throw new ConfigurationErrorsException("Unable to locate <redisConfig> section into your configuration file. Take a look https://github.com/imperugo/StackExchange.Redis.Extensions");
            }

            this.Configuration = configuration;
        }