-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configure services depending on the enabled feature #35
Comments
It breaks the pattern a bit because that would be attempting to consume the feature manager before the service provider has been built. Right now there is no clean built-in way to do this, you would have to build an intermediate service provider which is not a good approach. By the way, are you looking for something similar to what is discussed in this issue Azure/AppConfiguration#68 ? |
Sorry for late response, correct, it's a duplicate of the existing #39 |
hi, i have this code: services.AddHttpClient("ApiServices",
c => { c.BaseAddress = new Uri(Urls.ApiUrl); })
.ConfigurePrimaryHttpMessageHandler(() =>
{
if (disableSslCertValidation)
{
return new HttpClientHandler
{
ServerCertificateCustomValidationCallback =
(message, certificate, chain, sslPolicyErrors) => true
};
}
return new HttpClientHandler();
})
.AddTypedClient(RestService.IFor<ApiServices>); which would need to use feature management in |
Closing as a duplicate of #39 |
Hi,
What's the correct way to checking whether feature enabled from Startup.ConfigureServices?
I'd expect something like
services.AddForFeature(MyFeatures.RedisCache, x => x.Decorate<IMyService, MyCachedService>());
or
if (configuration.IsFeatureEnabled(MyFeatures.RedisCache)) { services.Decorate<IMyService, MyCachedService>(); }
but have not found a nice way of doing it. Have I missed something existing for this? Or such usage breaks design somehow?
The text was updated successfully, but these errors were encountered: