.NET 5 API Controllers

API Controllers in .NET 5 needs to be implemented slightly differently than .NET Framework controllers. I’ll go over some of the few differences when creating a .NET 5 controller. Base controllers In .NET 5, there are two different ways of creating a controller. Creating an MVC controller is slightly different than creating an API controller. Let’s start off by creating the .NET 5 solution using the .NET Core CLI. dotnet new sln -n WebApiExamples dotnet new webapi -n WebApiStartup dotnet sln ....

July 19, 2021 · 3 min · Samuel Tambunan