Xabaril / Esquio

Esquio is a Feature Toggle Library for .NET Developers.
Apache License 2.0
428 stars 49 forks source link

IsEnabledAsync for specific product and environments #140

Closed gkfischer closed 4 years ago

gkfischer commented 4 years ago

Environments are a new addition I'm realy hapy about, but it seems there is still a lack of possibilities to acutally use them, or I can't once again figure out how to use them properly.

The IFeatureService interface only defines

Task<bool> IsEnabledAsync(string featureName, CancellationToken cancellationToken = default);

but no

Task<bool> IsEnabledAsync(string featureName, string environmentName,  string productName, CancellationToken cancellationToken = default);

Am I missing something, or asked otherwise: how can I make use of the environment feature when I want to get the status of a feature?

unaizorrilla commented 4 years ago

Hi @gkfischer

The IFeatureService internally use the configured product name when you use AddEsquio extension method, you don't need to specify this on every call. If you need a feature enabled or not depending on ASP.NET CORE Environment Variable you can use the HostEnvironmentToggle for that!

Unai

gkfischer commented 4 years ago

Thanks, that pointed me in the right direction. I think I found a bug regarding toggle parameters of non default deployments along the way, but I'll open another issue for that.