Feature Management
Important Note
ArconQ.SDK automatically registers feature management for your application.
Do not call builder.Services.AddFeatureManagement() explicitly in your application code. Doing so will override the SDK's feature management configuration and prevent normal application behavior. It may result e.g. improper startup process.
Usage
To add custom feature flags, place them in your configuration under the ArconQ.FeatureManagement section:
{
"ArconQ": {
"FeatureManagement": {
"IsMyCustomFeatureEnabled": false
}
}
}
Access Feature Flags
Inject IFeatureManager and check your feature flags:
using Microsoft.FeatureManagement;
public class MyService
{
private readonly IFeatureManager _featureManager;
public MyService(IFeatureManager featureManager)
{
_featureManager = featureManager;
}
public async Task DoSomethingAsync()
{
if (await _featureManager.IsEnabledAsync("IsMyCustomFeatureEnabled"))
{
// Feature-specific code here
}
}
}