With routing, dependency injection, and a database in place, you can put them together into a well-designed REST API. A good API is more than endpoints that work: it has a stable contract, rejects bad input clearly, handles large result sets gracefully, and is documented so other developers can use it without reading your code.
This module starts with DTOs, which decouple what your API exposes from your internal entities. It then covers request validation with FluentValidation, followed by pagination, filtering, and sorting for list endpoints, and finishes with OpenAPI documentation and how to bring Swagger UI back in recent .NET versions.
Watch the lessons in order, then continue on to Authentication & Authorization.
Explains why an API should use data transfer objects instead of exposing entities directly, and how to apply them in an ASP.NET Core Web API. This one is a few years old, but the concept hasn't changed.
Shows how to replace manual if-else checks with FluentValidation rules for validating incoming data in your API.
Upgrades an ASP.NET Core Web API on .NET 10 with pagination, filtering, and sorting, the features list endpoints need in real-world applications.
Explains why Swagger is no longer available by default in .NET 9 API projects and how to add Swagger UI back using the built-in OpenAPI support.