In our previous post, we introduced Microsoft.FeatureManagement as a way to manage feature flag functionality in your .NET applications. As mentioned in the post, this library is compatible with any .NET Standard application.

In this post, we’ll kick things up a notch and show how you can pair this with an ASP.NET Core-only library, Microsoft.FeatureManagement.AspNetCore, to perform the following tasks with minimal required configuration:

  • Filter out controller action methods and classes
  • Conditionally filter out HTML in your views

This is part 2 in a four-part series on .NET native feature flags:

This post contains the following content.

Set up the sample application

If you wish to follow along, refer to the previous post for details on how we set up our sample application. In addition, you’ll need to add the Microsoft.FeatureManagement.AspNetCore library by performing one of the following two steps:

  • From the NuGet Package Manager (easiest way is to right-click your solution in Visual Studio, then clicking Manage NuGet Packages), search for and install Microsoft.FeatureManagement.AspNetCore
  • From the dotnet CLI, you can execute the dotnet add package Microsoft.FeatureManagement.AspNetCore command

#microsoft.featuremanagement.aspnetcore #html

Using Microsoft.FeatureManagement.AspNetCore to filter actions and HTML
1.40 GEEK