public TestAppConfig(IConfiguration configuration, IConfigurationRefresherProvider refresherProvider, IFeatureManagerSnapshot featureManagerSnapshot) { isLocal = string.IsNullOrEmpty(Environment.GetEnvironmentVariable("WEBSITE_INSTANCE_ID")); _configuration = configuration; _featureManagerSnapshot = featureManagerSnapshot; _configurationRefresher = refresherProvider.Refreshers.First(); }
public HomeController(IAlbumService albumService, IFeatureManagerSnapshot featureManager, IOptionsSnapshot <AppSettings> options, ILogger <HomeController> logger) { _albumService = albumService; _featureManager = featureManager; _appSettings = options.Value; _logger = logger; }
public HomeController(ILogger <HomeController> logger, IFeatureManagerSnapshot featureManager, IHttpContextAccessor contextAccessor) { _logger = logger; _featureManager = featureManager; _contextAccessor = contextAccessor; }
public LeeBus(IConfiguration configuration, IConfigurationRefresherProvider refresherProvider, IFeatureManagerSnapshot featureManagerSnapshot) { isLocal = string.IsNullOrEmpty(Environment.GetEnvironmentVariable("WEBSITE_INSTANCE_ID")); _configuration = configuration; _featureManagerSnapshot = featureManagerSnapshot; _configurationRefresher = refresherProvider.Refreshers.First(); connString = Environment.GetEnvironmentVariable("SqlServerConnection"); }
public NotificationController(ILoggerManger logger, INotificationRepository notification, IFeatureManagerSnapshot featureManager) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _notification = notification ?? throw new ArgumentNullException(nameof(notification)); _featureManager = featureManager ?? throw new ArgumentNullException(nameof(featureManager)); }
public WeatherForecastController(ILogger <WeatherForecastController> logger, IOptionsSnapshot <Settings> settings, IFeatureManagerSnapshot featureManager , ITemperatureService temperatureService) { _settings = settings; _featureManager = featureManager; _temperatureService = temperatureService; _logger = logger; }
public PublishServiceAcceptanceStepContext(IFeatureManagerSnapshot featureManagerSnapshot, ICalculationsApiClient calculationsInMemoryClient, ICalculationResultsRepository calculationsInMemoryRepository, IProfilingApiClient profilingApiClient) { _featureManagerSnapshot = featureManagerSnapshot; CalculationsInMemoryRepository = (CalculationInMemoryRepository)calculationsInMemoryRepository; CalculationsInMemoryClient = (CalculationsInMemoryClient)calculationsInMemoryClient; ProfilingInMemoryClient = (ProfilingInMemoryClient)profilingApiClient; }
public FeatureManagementController( IOptionsMonitor <AppOptions> optionsMonitor, ConfigurationService optionsService, IFeatureManagerSnapshot featureManager) { _options = optionsMonitor.CurrentValue; optionsMonitor.OnChange(n => _options = n); _optionsService = optionsService; _featureManager = featureManager ?? throw new System.ArgumentNullException(nameof(featureManager)); }
public ConnectingDemo(IConfiguration configuration, IFeatureManagerSnapshot featureManagerSnapshot, IConfigurationRefresherProvider refresherProvider) { // Connects to a storage queue client. Address looks like https://identitydemo.queue.core.windows.net // The queuename is just a valid queue name. _client = new QueueClient(new Uri($"{configuration["Queue:Uri"]}/{configuration["Queue:Name"]}"), new DefaultAzureCredential(), new QueueClientOptions() { MessageEncoding = QueueMessageEncoding.Base64 }); _client.CreateIfNotExists(); // Grab the feature flag API _featureManagerSnapshot = featureManagerSnapshot; _configurationRefresher = refresherProvider.Refreshers.First(); }
/// <summary> /// Performs controller action pre-procesing to ensure that at least one of the specified features are enabled. /// </summary> /// <param name="context">The context of the MVC action.</param> /// <param name="next">The action delegate.</param> /// <returns>Returns a task representing the action execution unit of work.</returns> public override async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next) { IFeatureManagerSnapshot fm = context.HttpContext.RequestServices.GetRequiredService <IFeatureManagerSnapshot>(); // // Enabled state is determined by either 'any' or 'all' features being enabled. bool enabled = RequirementType == RequirementType.All ? await Features.All(async feature => await fm.IsEnabledAsync(feature).ConfigureAwait(false)) : await Features.Any(async feature => await fm.IsEnabledAsync(feature).ConfigureAwait(false)); if (enabled) { await next().ConfigureAwait(false); } else { IDisabledFeaturesHandler disabledFeaturesHandler = context.HttpContext.RequestServices.GetService <IDisabledFeaturesHandler>() ?? new NotFoundDisabledFeaturesHandler(); await disabledFeaturesHandler.HandleDisabledFeatures(Features, context).ConfigureAwait(false); } }
public ClassSwitcher(IEnumerable <TInterface> classes, IFeatureManagerSnapshot featureManager, IEnumerable <IOptions <ClassSwitcherOptions> > options) { var classList = classes?.ToList() ?? throw new ArgumentNullException(nameof(classes)); if (classList.Count < 2) { throw new ArgumentOutOfRangeException(nameof(classes), $"Minimum number of expected classes of {typeof(TInterface)} is 2, found {classList.Count}"); } _featureManager = featureManager ?? throw new ArgumentNullException(nameof(featureManager)); options = options?.ToList() ?? throw new ArgumentNullException(nameof(options)); if (!options.Any()) { throw new ArgumentNullException(nameof(options)); } _option = options.FirstOrDefault(item => item.Value.Interface == typeof(TInterface))?.Value ?? throw new ArgumentOutOfRangeException(nameof(options), $"No options found for {typeof(TInterface)}"); _flagDisabledClass = classList.FirstOrDefault(item => item.GetType() == typeof(TFlagDisabledClass)); _flagEnabledClass = classList.FirstOrDefault(item => item.GetType() == typeof(TFlagEnabledClass)); }
public Function1(IFeatureManagerSnapshot featureManager) { _featureManager = featureManager; }
public ShowBetaFeature(IFeatureManagerSnapshot featureManagerSnapshot, IConfigurationRefresherProvider refresherProvider) { _featureManagerSnapshot = featureManagerSnapshot; _configurationRefresher = refresherProvider.Refreshers.First(); }
public HomeController(IFeatureManager featureManager, IFeatureManagerSnapshot featureManagerSnapshot) { _featureManager = featureManager; _featureManagerSnapshot = featureManagerSnapshot; }
public FeatureFlags(IFeatureManagerSnapshot featureManagerSnapshot, IOptionsSnapshot <Settings> settings, IConfiguration configuration) { _featureManagerSnapshot = featureManagerSnapshot; _settings = settings.Value; _configuration = configuration; }
public HomeController(ILogger <HomeController> logger, IFeatureManagerSnapshot featureManager) { _logger = logger; _featureManager = featureManager; }
public AlbumService(IAlbumRepository albumRepository, IFeatureManagerSnapshot featureManager, IOptionsSnapshot <AppSettings> options) { _albumRepository = albumRepository; _featureManager = featureManager; _appSettings = options.Value; }
public TimedController(IFeatureManagerSnapshot featureManager) { _featureManager = featureManager; }
public ContratoController(IMemoryCache memoryCache, IFeatureManagerSnapshot featureManager) { _cache = memoryCache; _featureManager = featureManager; }
public ShowBetaFeature(IFeatureManagerSnapshot featureManagerSnapshot, ILoggerFactory loggerFactory) { _featureManagerSnapshot = featureManagerSnapshot; _logger = loggerFactory.CreateLogger <ShowBetaFeature>(); }
/// <summary> /// Creates a feature tag helper. /// </summary> /// <param name="featureManager">The feature manager snapshot to use to evaluate feature state.</param> public FeatureTagHelper(IFeatureManagerSnapshot featureManager) { _featureManager = featureManager; }
public WeatherForecastController(ILogger <WeatherForecastController> logger, IFeatureManagerSnapshot featureManager) { _logger = logger; _featureManager = featureManager; }
public HomeController(IFeatureManagerSnapshot featureSnapshot) => FeatureManager = featureSnapshot;
public IndexModel(ILogger <IndexModel> logger, BlogService blogService, IFeatureManagerSnapshot featureManager) { _blogService = blogService; _featureManager = featureManager; _logger = logger; }
public FeatureManagerSnapshot(IFeatureManagerSnapshot baseFeatureManagerSnapshot) { _baseFeatureManagerSnapshot = baseFeatureManagerSnapshot; }
public HelloWorld(IFeatureManagerSnapshot featureManagerSnapshot) { _featureManagerSnapshot = featureManagerSnapshot; }
public HomeController(IHttpClientFactory httpClientFactory, IFeatureManagerSnapshot featureManager) { _cl = httpClientFactory; _featureManager = featureManager; }
public BetaModel(IFeatureManagerSnapshot featureManager) { _featureManager = featureManager; }
public BetaController(IFeatureManagerSnapshot featureManager) { _featureManager = featureManager; }
public HomeController(IFeatureManagerSnapshot featureManager) => _featureManager = featureManager;