← All recipes
Moderne licensed

Migrate ApiController to ControllerBase

Recipe IDOpenRewrite.Recipes.CSharp.Migration.Dotnet.Net3_0.UseApiControllerBaseArtifactOpenRewrite.Recipes.CSharp.Migration.Dotnet

Replace ApiController base class (from the removed WebApiCompatShim) with ControllerBase and add the [ApiController] attribute. The shim was removed in ASP.NET Core 3.0.

Single recipecsharpdotnetaspnetcoremigrationProprietary

Usage

This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe OpenRewrite.Recipes.CSharp.Migration.Dotnet.Net3_0.UseApiControllerBase

If the recipe isn’t available locally, install it with:

mod config recipes nuget install OpenRewrite.Recipes.CSharp.Migration.Dotnet