-
Notifications
You must be signed in to change notification settings - Fork 123
Open
Description
I’m implementing a custom IFeatureDefinitionProvider that reads features from a database or an HTTP service instead of JSON configuration. My goal is to represent a feature that is always enabled, equivalent to this JSON:
"FeatureA": {
"enabled": true
}Looking at the source (ConfigurationFeatureDefinitionProvider.ParseMicrosoftSchemaFeatureDefinition), the library seems to convert such JSON into a FeatureDefinition with:
Status = FeatureStatus.ConditionalEnabledForcontaining a singleFeatureFilterConfigurationwithName = "AlwaysOn"
Example based on my understanding:
var featureEnabled = new FeatureDefinition
{
Name = "FeatureA",
EnabledFor = new List<FeatureFilterConfiguration>
{
new FeatureFilterConfiguration { Name = "AlwaysOn" }
},
Status = FeatureStatus.Conditional
};My questions:
- Is this the correct/recommended way to create a feature that is always enabled without defining any conditions?
- Is there an official API or helper for this, so I don’t have to replicate the logic from
ConfigurationFeatureDefinitionProvider? - Are there any docs explaining this behavior?
I want to make sure my IFeatureDefinitionProvider correctly handles “always enabled” features without relying on JSON files.
Thanks!
Metadata
Metadata
Assignees
Labels
No labels