Minimal APIs in ASP.NET 6.0
summary
Live demo upgrades a .NET 5 app to .NET 6 and shows concrete C# 10 changes: file-scoped namespaces and global/implicit usings, top‑level statements and the new WebApplication.CreateBuilder. Minimal APIs use app.MapGet/MapPost/MapPut, return typed bodies via Results (e.g. Results.BadRequest), and support DI into handler parameters. Builds a 46‑line microservice that serves JSON, Swagger and health checks, and demonstrates unit and in‑memory integration tests by exposing Program as a public partial for TestServer—no theory, just working code and measurable improvements.
AI-written summary · about
chapters (11)
- 0:00Introduction and welcome
- 2:24Building a minimal API
- 5:33Overview of ASP.NET 5 app
- 8:40Upgrading to .NET 6
- 10:20C# 10 file-scoped namespaces
- 12:34Global usings and centralization
- 14:29Implicit usings
- 18:23Refactoring Program.cs
- 24:38Advanced minimal APIs
- 37:16Testing minimal APIs
- 47:28Microservices with minimal APIs








