Table of Contents

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:

  1. appsettings.json (defaults)
  2. State-specific JSON (appsettings.{State}.json)
  3. AWS AppConfig Agent (if configured — highest priority)
public class FeatureFlagQueryService : IFeatureFlagQueryService
Inheritance
object
FeatureFlagQueryService
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

featureManager IFeatureManager

The feature manager from Microsoft.FeatureManagement.

outagePageStateResolver IOutagePageStateResolver

Resolves outage page state per surface.

logger ILogger<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

cancellationToken CancellationToken

A token to monitor for cancellation requests.

Returns

Task<Dictionary<string, bool>>

A dictionary of feature flag names to their enabled state.