What problem does it solve?
Many .NET Web APIs end up with business logic in controllers, inconsistent error responses, and no centralized dispatch mechanism. This Skill provides patterns to keep controllers thin, route work through MediatR, and return standardized ProblemDetails responses for errors.
Core Features & Use Cases
- Base Controller Pattern: Centralizes access to ISender so controllers delegate to MediatR handlers rather than containing business logic.
- CRUD Controller Template: Demonstrates common GET/POST/PUT/DELETE endpoints with appropriate status codes and validation error responses.
- Global Exception Handler: Maps domain and validation exceptions to ProblemDetails with appropriate HTTP status codes and centralized logging.
- Use Case: Implementing an OrdersController that handles pagination, retrieval, creation, updates, and deletions while delegating to MediatR handlers and returning consistent error payloads.
Quick Start
Create an OrdersController that inherits from BaseController, forwards commands and queries to MediatR, and returns ProblemDetails for errors.