dontcodetired.com dontcodetired.com

Conditional HTML Rendering with Microsoft Feature Flags (Microsoft.FeatureManagement)

This is part seven in a series of articles. You can render HTML in your views based on whether or not a feature flag is enable or disabled. To do this you can make use of the FeatureTagHelper. For example suppose the following Printing feature is configured to be off in the appsettings.json:"FeatureManagement": { "Printing": false } Now in the view (or _ViewImports.cshtml) you can add the tag helper and then...

dontcodetired.com dontcodetired.com

Preventing Inconsistent Feature Flag Values During a Single Request (Microsoft.FeatureManagement)

This is part six in a series of articles. If you check a feature flag multiple times during a single HTTP request in ASP.NET Core, the feature can return a different results for each check. For example, the Microsoft.Percentage feature filter which we looked at in part three enables a feature for a specified percentage of feature checks:"FeatureManagement": { "Printing": { "EnabledFor": [ { ...

dontcodetired.com dontcodetired.com

Microsoft Feature Flags: Implementing Custom Feature Filters (Microsoft.FeatureManagement)

This is part four in a series of articles. In part three I introduced the concept of feature filters. These allow features to be enabled/disabled based on more than a simple true/false configuration. Currently there are 2 feature filters supplied out of the box, a percentage filter and a time window feature. You can also create you own custom feature filters. Creating a Simple Custom Feature Filter To create a custom feature filter,...