public void AddSpecification(IToggleSpecification specification) { if (specification == null) { throw new ArgumentNullException(nameof(specification)); } _specificationData.Add(specification, new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase)); }
public FileProvider(IFileReader fileReader) { _fileReader = fileReader; var defaultSpecifications = new IToggleSpecification[] { new TrueSpecification(), new FalseSpecification() }; _specifications = defaultSpecifications.ToDictionary(x => x.Name, StringComparer.OrdinalIgnoreCase); }
public IToggleChecker Create() { if (_userProvider == null) _userProvider = new NullUserProvider(); if(_defaultToggleSpecification==null) _defaultToggleSpecification = new FalseSpecification(); var featureProvider = _featureProviderFactory.Create(); return new ToggleChecker(featureProvider, _defaultToggleSpecification, _userProvider); }
public IToggleChecker Create() { if (_userProvider == null) { _userProvider = new NullUserProvider(); } if (_defaultToggleSpecification == null) { _defaultToggleSpecification = new BoolSpecification(false); } var featureProviders = _featureProviderFactories.Select(factory => factory.Create()).ToArray(); return(new ToggleChecker(featureProviders, _defaultToggleSpecification, _userProvider)); }
public IToggleChecker Create() { if (_userProvider == null) { _userProvider = new NullUserProvider(); } if (_defaultToggleSpecification == null) { _defaultToggleSpecification = new FalseSpecification(); } var featureProvider = _featureProviderFactory.Create(); return(new ToggleChecker(featureProvider, _defaultToggleSpecification, _userProvider)); }
public Feature(IToggleSpecification specification) { _specificationData = new Dictionary <IToggleSpecification, IDictionary <string, string> >(); AddSpecification(specification); }
internal ToggleChecker(IEnumerable <IFeatureProvider> featureProviders, IToggleSpecification defaultToggleSpecification, IUserProvider userProvider) { _featureProviders = featureProviders; _defaultToggleSpecification = defaultToggleSpecification; _userProvider = userProvider; }
public void AddMapping(string specificationName, IToggleSpecification specification) { _mappings.Add(specificationName, specification); }
public void AddSpecification(IToggleSpecification specification) { if(specification==null) throw new ArgumentNullException("specification"); _specifications.Add(specification); }
public Feature(string flagName, IToggleSpecification specification) { FlagName = flagName; _specifications = new List<IToggleSpecification>(); AddSpecification(specification); }
public ToggleConfiguration SetDefaultSpecification(IToggleSpecification toggleSpecification) { _defaultToggleSpecification = toggleSpecification; return(this); }
public void AddParameter(IToggleSpecification specification, string parameterName, string parameterValue) { _specificationData[specification].Add(parameterName, parameterValue); }
internal ToggleChecker(IFeatureProvider featureProvider, IToggleSpecification defaulToggleSpecification, IUserProvider userProvider) { _featureProvider = featureProvider; _defaulToggleSpecification = defaulToggleSpecification; _userProvider = userProvider; }
public void AddSpecification(IToggleSpecification specification) { if(specification==null) throw new ArgumentNullException(nameof(specification)); _specificationData.Add(specification, new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)); }
public Feature(IToggleSpecification specification) { _specificationData = new Dictionary<IToggleSpecification, IDictionary<string, string>>(); AddSpecification(specification); }
internal ToggleChecker(IFeatureProvider featureProvider, IToggleSpecification defaultToggleSpecification, IUserProvider userProvider) { _featureProvider = featureProvider; _defaultToggleSpecification = defaultToggleSpecification; _userProvider = userProvider; }
public ToggleConfiguration SetDefaultSpecification(IToggleSpecification toggleSpecification) { _defaultToggleSpecification = toggleSpecification; return this; }