API Design for ASP.NET Cores
ASP.NET Core API design is shaping HTTP endpoints that are consistent and easy to consume. It covers REST conventions, status codes, DTOs, validation, pagination and error responses using ProblemDetails, plus response and output caching and hosted services for background work that should not block requests.
Stage: Data · Part of the ASP.NET Core roadmap · Last reviewed 19 November 2026
What to learn in API Design
- Design resource URLs and choose correct HTTP verbs and status codes
- Validate input and return a ProblemDetails error response
- Use DTOs so entities are not exposed directly
- Add pagination to a list endpoint
- Run background work with a BackgroundService
API Design interview questions
Why should an API return DTOs rather than EF entities?
Entities mirror the database and can expose internal fields, create circular references and tie the public contract to the schema. DTOs let you return only the needed fields, shape data for clients and change the database without breaking the API.
How do minimal APIs differ from controllers?
Minimal APIs map endpoints directly with lambdas or methods in Program.cs, with less ceremony and lower overhead. Controllers use classes with attributes and offer built-in conventions such as model validation filters and the full MVC feature set. Both run on the same pipeline.
Where API Design fits in the ASP.NET Core roadmap
API Design belongs to the Data stage (intermediate level), which takes about 28 hours. Persistence.
Other units in this stage
Back to the full ASP.NET Core roadmap