
The Repository pattern abstracts data access, while Unit of Work coordinates changes.
Repository: Provides methods like Add, GetById, List for aggregates.
Unit of Work: Wraps SaveChangesAsync to commit a transaction.
EF Core's DbContext already acts as a unit of work and repository, but explicit repositories can enforce aggregate boundaries and domain-specific queries.
Architecture impact: Use repositories to keep application and domain layers independent of EF Core specifics.
Reference:
TaskLoco™ — The Sticky Note GOAT