コード例 #1
0
        public ICacheProvider Build()
        {
            if (_serializer == null)
            {
                throw new Exception("Serializer is required. Please provide an instance of ISerializer");
            }

            if (_connectionSettings == null)
            {
                _connectionSettings = ConnectionSettingsSection.Instance(_settingsSectionName ?? DefaultSettingsSectionName);
            }

            if (_connectionFactory == null)
            {
                _connectionFactory = new ConnectionFactory(_connectionSettings);
            }

            return(new RedisCacheProvider(DefaultName, DefaultOrder, _connectionSettings, _connectionFactory, _serializer));
        }