What problem does it solve?
Centralizes data access to prevent leaky abstractions, reduce duplicated EF Core usage, and ensure transactional consistency across aggregate operations so handlers and services remain domain-focused and testable.
Core Features & Use Cases
- Repository per aggregate root: Encourages modeling repositories around aggregate roots rather than individual entities.
- Unit of Work coordination: Shows how DbContext can act as the UoW and how to expose SaveChanges through an interface.
- Generic + specialized repositories: Provides patterns for open-generic CRUD and aggregate-specific queries, including examples with Include, AsSplitQuery, and ordering.
- Specification support & DI: Describes integrating Ardalis.Specification and registering repositories and UoW with dependency injection for production use.
- Use Case: Implementing an Order aggregate with a specialized IOrderRepository that returns domain entities and supports complex query scenarios like pagination and projections.
Quick Start
Use this skill to implement repository interfaces, a Unit of Work, generic and specialized EF Core repository implementations, and register them with DI in your .NET project.