Introduction
Prior to .Net Core 6.0, REST API would be the most popular approach to creating HTTP API.
Minimal API is a new approach introduced in .Net core 6.0 to create REST API.
The aim of Minimal API is to streamline code verbosity, configuration processes, and formalities.
We will be exploring Minimal API, an exciting new feature that Microsoft has recently introduced, in this article.
In this article, we will delve into a topic that can benefit beginners, intermediates, and professionals alike.
- What is Minimal API
- Advantages of Minimal API
- Disadvantages or limitations of Minimal API
- Enhancement and Improvement in .Net 8.0
- CRUD Example
Prerequisites
- Visual Studio 2022
- Understanding of REST API
If you're unfamiliar with the fundamental concepts of WEB API, I suggest reading the following articles first. WebAPI
Let’s start with,
What is Minimal API?
Q. What steps should be taken to develop an HTTP API with minimal dependencies prior to .Net Core 6. 0?
Answer. The solution lies in developing an REST API that is complete with its entire structure. This means we need an entire REST API structure even for simple APIs.
To resolve this, Microsoft introduced Minimal API. Minimal APIs are designed to construct HTTP APIs with minimum dependencies. They are ideal for microservices and applications that aim to include only the essentials in terms of files, features, and dependencies within ASP. NET Core.
Advantages of Minimal API
Below are a few important advantages of the Minimal API.
- Lightweight RESTful APIs without a traditional controller
- Simplified routing
- Reduce overhead
- Improve performance
- More useful for microservices
- Accelerated Development
Now, we will discuss the disadvantages of the Minimal Api.
Disadvantages
- No building support for model binding
- No building support for validation
- No building support for filters.
- Additional learning and experience required
- No building View rending support
- Minimal APIs, being a newer approach, may feature a less developed ecosystem in comparison to the well-established ASP. NET Core MVC.
- The traditional REST API approach is more suitable for complex system
- Maintenance and readability are not suitable if we have more endpoints.
- No inbuild support for OData
- Versioning is not supported.
In the .NET 8, Microsoft has provided enhancements to the Minimal API. A few of the important improvements we will cover here,
Enhancement and Improvement in .Net 8.0
- Build in Validation
- Performance improvement
- Dependency Injection
- Authorization
- Authentication
- Enhancement in Route Handling
- Improvement in Swagger and OpenID integration.
Let’s create a simple Minimal API now.
CRUD Example
In this case, we will develop a basic Minimal API that handles CRUD operations.
Below are the endpoints we will create using the Mini API project.
| No | Task | Endpoint | Expected Result |
| 1 | Get All Employees | /Employees | Retrieved all employees |
| 2 | Get Employee by ID | /Employees/{empid} | Get employee requested by employee ID |
| 3 | Add new Employee | /Employees | Add new employee |
| 4 | Update Employee details | /Employees/{empid} | Update Employee details |
| 5 | Delete Employee | /Employees/{empid} | Delete Employee |








Join the conversation! Your thoughts help the community grow.