Currently there is IVariantServiceProvider that provides feature-based injection. But it relies on using complicated variants and allocation concepts which might not be needed. So it would be great to have simpler solution compatible with .NET feature management schema.
I see this as some IFeatureServiceProvider with similar API to IVariantServiceProvider where method GetServiceAsync works by simpler algorithm:
- evaluate feature state
- if disabled return default
- if enabled return new
While DI could be configured with new method WithFeatureService:
services.AddFeatureManagement().WithFeatureService<IService, DefaultImpl, NewImpl>("Feature");
Currently there is
IVariantServiceProviderthat provides feature-based injection. But it relies on using complicated variants and allocation concepts which might not be needed. So it would be great to have simpler solution compatible with .NET feature management schema.I see this as some
IFeatureServiceProviderwith similar API toIVariantServiceProviderwhere methodGetServiceAsyncworks by simpler algorithm:While DI could be configured with new method
WithFeatureService: