Exemplo n.º 1
0
        public async Task <TFeature> Get <TFeature>() where TFeature : Feature
        {
            var feature = await provider.Get(typeof(TFeature).Name).ConfigureAwait(false);

            if (feature == null)
            {
                throw new ArgumentException($"A feature named {typeof(TFeature).Name} was not found.");
            }

            return((TFeature)feature);
        }
Exemplo n.º 2
0
        public bool IsEnabled(string toggleName)
        {
            var feature     = _featureProvider.Get(toggleName);
            var currentUser = _userProvider.CurrentUser();

            return(feature?.IsEnabled(currentUser) ?? _defaultToggleSpecification.IsEnabled(currentUser, new Dictionary <string, string>()));
        }
Exemplo n.º 3
0
        public async Task <TFeature> Get <TFeature>()
        {
            var feature = await provider.Get <TFeature>().ConfigureAwait(false);

            if (feature == null)
            {
                throw new ArgumentException($"A feature named {(feature.GetType().Name)} was not found.");
            }

            return(feature);
        }
 public IEnumerable <Feature> Get()
 {
     return(_featureProvider.Get());
 }