Introduction
In this article, we will talk about the new feature introduced in .NET Core 6.0, i.e., minimal APIs (API without using controllers).
It will cover the following topics:
- What is Minimal API?
- The history of Minimal API
- Hands-on Lab – Create a .NET Core API project and Implement Minimal API
What is Minimal API?
- Minimal APIs are used to create HTTP APIs with minimal dependencies.
- They are ideal for microservices and apps that want to include only minimum files, features, and dependencies in ASP.NET Core.
- This tutorial teaches the basics of building a minimal web API with ASP.NET Core.
History of Minimal API
- The story of the minimal API started in November 2019. The developer community saw the implementation of the distributed calculator in Go, Python, C#, and Javascript.
- When the community began comparing how many files and lines of code were needed to do almost the same thing with C# compared to other languages, it was apparent that C# seemed more complicated than the rest of them.
- Imagine the number of concepts and features accumulated over the years and how overwhelming it might be for a newcomer to dig into the world of .NET web development. Therefore, a .NET Core team wanted to reduce the complexity for all developers (newcomers and veterans) and embrace minimalism. So, if we’re going to create a simple API with a single endpoint, we should be able to do it within a single file. But, if we need to switch later to using controllers again, we should also be able to do that.
Hands-on Lab – Create a .NET Core API project and Implement Minimal API
Steps to be followed:
- Open VS 2022 and create a project.
- Choose ASP.NET Core API as a template and create a directory.

- Uncheck the use controllers options from the below image to use minimal APIs.










Ganesh ChikhalikarPosted Aug 10, 2022, 4:44 AM
Informative