Table of Contents
Minimal APIs are becoming a key architectural pattern in the .NET ecosystem—leaner, faster, and easier to write than traditional controller-based Web APIs. With the release of ASP.NET Core 9 (Preview), the Minimal API model receives a host of improvements in performance, routing, dependency injection, and OpenAPI support.
To showcase all of this in action, I’ve built a complete demo application that demonstrates how to build a real-world, production-grade API using the Minimal API pattern. This app was featured during my talk at the Rome .NET Conference 2025, organized and hosted by the DotNetCore community.
What This Project Covers
- How to build a Minimal API using ASP.NET Core 9
- Comparison with traditional Web APIs (controller-based)
- Benefits, drawbacks, and ideal use cases
- Deep dive into .NET 9’s new features
- OpenAPI support with Swagger UI, ReDoc, and Scalar
- Performance gains (up to 93% memory usage reduction)
- Interactive benchmarking with Postman and nBomber
Application Features
This demo isn’t just a Hello World—it’s a complete, modular application that demonstrates:
- Pure Minimal API architecture with no MVC Controllers
- Entity Framework Core with a Code-First approach and a lightweight SQLite database
- Repository Pattern with generic and specific interfaces
- Database Seeding with Bogus (a .NET port of Faker.js)
- Out-of-the-box OpenAPI integration:
- Swagger UI
- ReDoc
- Scalar
At the end of the session, we'll also run real-time benchmarks and performance tests on the app using Postman and nBomber tools.
Project Structure
1 2 3 4 5 6 7 8 9 |
NC2025_MinimalAPI_NET9/ ├── Program.cs # Entry point with service registration and endpoint mapping ├── Extensions/ # Fluent-style builder and app configuration ├── Models/ # Data models for EF Core ├── Repositories/ # Interfaces and implementations for data access ├── Data/ # ApplicationDbContext, seeders, initializers ├── Configuration/ # Swagger and OpenAPI setup └── Properties/launchSettings.json |
How to Run the App
- Install .NET 9 SDK (Preview)
- Clone the repo:
12git clone https://github.com/Ryadel/NC2025_MinimalAPI_NET9.gitcd NC2025_MinimalAPI_NET9 - Run the app:
1dotnet run - Browse to:
1https://localhost:7053/swagger/docs
(ReDoc) or/scalar
(Scalar).
Benchmarking and API Testing
Use Postman to test the API endpoints and structure. Then, simulate load tests and gather performance metrics with nBomber. The project is pre-configured to support realistic test scenarios and seeded data.
Topics from the NC2025 Conference Session
- Minimal APIs: what they are and how they work
- How they compare to controller-based Web APIs
- Performance improvements in .NET 9
- Native OpenAPI and Swagger integration
- Parameter binding, validation, and request handling
- Code-first database design with EF Core + SQLite
- Repository pattern for clean separation of concerns
- Real-world testing: Postman + nBomber
Final Thoughts
This project serves as both a learning resource and a template for building production-ready Minimal APIs using ASP.NET Core 9. Whether you're exploring the Minimal API paradigm for the first time or evaluating its place in your architecture, this app can help you take the next step.