What problem does it solve?
Vertical slice architecture prevents .NET codebases from collapsing back into layered, hard-to-maintain structures by ensuring each feature owns its endpoints, contracts, validation, and behavior.
Core Features & Use Cases
- Feature-first folder structure: Organizes code by use-case (slice) instead of technical layer, reducing coupling and making changes localized.
- IEndpointGroup-based routing: Enables each feature to register its own endpoints cleanly and consistently in Program.cs.
- Per-feature DTOs and validation: Uses records for request/response types and FluentValidation per request to keep contracts isolated and enforce correctness early.
- Slice-focused testing guidance: Supports both full-stack slice tests (WebApplicationFactory) and handler-level unit tests without brittle DbContext mocking.
Quick Start
Use the vertical-slice skill to restructure your API by creating one folder per feature (e.g., Orders/CreateOrder), moving the endpoint, request/response DTOs, validator, and handler together, and then registering all IEndpointGroup implementations from Program.cs.