public void Observe(IFeatureConfiguration configuration, FeatureConfigurationStatus status) { lock (@lock) { configurations.Add(configuration, status); } }
private void Enforce(IFeatureConfiguration configuration, FeatureConfigurationStatus status) { var currentStatus = configuration.GetStatus(); if (currentStatus != status) { logger.Warn($"{configuration} is {currentStatus.ToString().ToLower()} instead of {status.ToString().ToLower()}!"); if (status == FeatureConfigurationStatus.Disabled) { configuration.DisableFeature(); } else if (status == FeatureConfigurationStatus.Enabled) { configuration.EnableFeature(); } } }