Last active
September 17, 2020 13:49
-
-
Save AvgustPol/a751a7d6c555a6135a09c978a4dfd19e to your computer and use it in GitHub Desktop.
feature switch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
//other configs | |
, | |
"FeatureManagement": { | |
"FeatureName": true | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (await _featureManager.IsEnabledAsync(Constants.FeatureManagement.FeatureName))) | |
{ | |
// do something | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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