Exemplo n.º 1
0
        public FeatureDefinitionManager(
            IOptions <FeatureOptions> options,
            IServiceProvider serviceProvider)
        {
            _serviceProvider = serviceProvider;
            Options          = options.Value;

            Providers          = new Lazy <List <IFeatureDefinitionProvider> >(CreateFeatureProviders, true);
            FeatureDefinitions = new Lazy <IDictionary <string, FeatureDefinition> >(CreateFeatureDefinitions, true);
        }
Exemplo n.º 2
0
        public FeatureChecker(
            IOptions <FeatureOptions> options,
            IServiceProvider serviceProvider,
            IFeatureDefinitionManager featureDefinitionManager)
        {
            FeatureDefinitionManager = featureDefinitionManager;

            Options = options.Value;

            Providers = new Lazy <List <IFeatureValueProvider> >(
                () => Options
                .ValueProviders
                .Select(type => serviceProvider.GetRequiredService(type) as IFeatureValueProvider)
                .ToList(),
                true
                );
        }
        public FeatureDefinitionManager(
            IOptions <FeatureOptions> options,
            IServiceProvider serviceProvider)
        {
            _serviceProvider = serviceProvider;
            Options          = options.Value;

            _lazyFeatureDefinitions = new Lazy <Dictionary <string, FeatureDefinition> >(
                CreateFeatureDefinitions,
                isThreadSafe: true
                );

            _lazyFeatureGroupDefinitions = new Lazy <Dictionary <string, FeatureGroupDefinition> >(
                CreateFeatureGroupDefinitions,
                isThreadSafe: true
                );
        }
Exemplo n.º 4
0
        public FeatureDefinitionManager(
            IOptions <FeatureOptions> options,
            IServiceScopeFactory serviceScopeFactory)
        {
            _serviceScopeFactory = serviceScopeFactory;
            Options = options.Value;

            _lazyFeatureDefinitions = new Lazy <Dictionary <string, FeatureDefinition> >(
                CreateFeatureDefinitions,
                isThreadSafe: true
                );

            _lazyFeatureGroupDefinitions = new Lazy <Dictionary <string, FeatureGroupDefinition> >(
                CreateFeatureGroupDefinitions,
                isThreadSafe: true
                );
        }