I'm trying to get the Repository/UnitOfWork pattern figured out. We're working on a project with EntityFramework and our DBContext contains 200+ tables.
Right now our approach is to inject whatever repository is required to a service. This way the services can only call a few methods from the passed repository. Services are easy to test because it's easy to fake the injected repositories.
- When using a UnitOfWork pattern, should the
UnitOfWorkcontain every single
Repositoryfrom the project?
- Would it be ok to have multiple, different UnitOfWorks (containing different Repositories) for different parts of an application?