Skip to content

Instantly share code, notes, and snippets.

@AvgustPol
Last active September 17, 2020 13:49
Show Gist options
  • Save AvgustPol/a751a7d6c555a6135a09c978a4dfd19e to your computer and use it in GitHub Desktop.
Save AvgustPol/a751a7d6c555a6135a09c978a4dfd19e to your computer and use it in GitHub Desktop.
feature switch
{
//other configs
,
"FeatureManagement": {
"FeatureName": true
}
}
NET Core 3.1 has build-in feature switch mechanism:
Must have in the future :wink:
2 Nuget packages has to be installed:
https://www.nuget.org/packages/Microsoft.FeatureManagement/
https://www.nuget.org/packages/Microsoft.FeatureManagement.AspNetCore/
Quick demo:
https://youtu.be/6EebLChouDE
if (await _featureManager.IsEnabledAsync(Constants.FeatureManagement.FeatureName)))
{
// do something
}
@using Microsoft.FeatureManagement
@inject IFeatureManager FeatureManager
@addTagHelper *, Microsoft.FeatureManagement.AspNetCore
<feature name="FeatureName">
</feature>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment