What problem does it solve?
This Skill provides clear guidance and patterns to avoid mixed responsibilities and tightly coupled logic by separating commands (writes) from queries (reads) when building .NET applications.
Core Features & Use Cases
- Command and Query Patterns: Naming conventions and example request/response DTOs for Create/Update/Delete commands and Get/List queries.
- Handlers and Pipeline Behaviors: Sample MediatR handlers, registration guidance, and pipeline behavior ordering for validation, logging, and transactions.
- Integration Advice: Minimal API and Controller wiring examples, database query best-practices such as AsNoTracking, and folder organization for Clean Architecture and VSA projects.
- Use Case: Build an order management feature with CreateOrderCommand handlers, validators, and ListOrdersQuery handlers that return paged responses.
Quick Start
Add CQRS by creating command and query types, register MediatR and pipeline behaviors, and move controller logic into handlers to enforce separation of concerns.