Class FeatureFlagQueryService
- Namespace
- SEBT.Portal.Infrastructure.Services
- Assembly
- SEBT.Portal.Infrastructure.dll
Service for querying feature flags. Priority order is as follows, with latest being high priority:
- appsettings.json (defaults)
- State-specific JSON (appsettings.{State}.json)
- AWS AppConfig Agent (if configured — highest priority)
public class FeatureFlagQueryService : IFeatureFlagQueryService
- Inheritance
-
objectFeatureFlagQueryService
- Implements
Constructors
FeatureFlagQueryService(IFeatureManager, IOutagePageStateResolver, ILogger<FeatureFlagQueryService>)
Initializes a new instance of the FeatureFlagQueryService class.
public FeatureFlagQueryService(IFeatureManager featureManager, IOutagePageStateResolver outagePageStateResolver, ILogger<FeatureFlagQueryService> logger)
Parameters
featureManagerIFeatureManagerThe feature manager from Microsoft.FeatureManagement.
outagePageStateResolverIOutagePageStateResolverResolves outage page state per surface.
loggerILogger<FeatureFlagQueryService>The logger.
Methods
GetFeatureFlagsAsync(CancellationToken)
Gets all configured feature flags as a dictionary. Flags are read from FeatureManager, which already has merged values from IConfiguration based on provider priority order configured at startup in Program.cs. Only flags that are explicitly configured (enabled or disabled) are returned. Unknown flags, internal-only flags, and backend-only flags are not included in the response.
public Task<Dictionary<string, bool>> GetFeatureFlagsAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to monitor for cancellation requests.
Returns
- Task<Dictionary<string, bool>>
A dictionary of feature flag names to their enabled state.