In this post we are going to see the example 2 of implementation of repository pattern and unit of work in .Net10. we separate the project in to four layers.
1. Domain or Entities
2. Application or UseCase
3. Infrastructure
4. Controllers
Dependencies:
Domain or Entities:
- It is consists of Entities.
- It is consists of Repositories and Unit Of Work Interfaces.
- It is consists of declaration of Application Service Interfaces with public access.
- It is consists of Implementation of Application Services with internal access,
- Usage of Repositories in the Application Services
- To register the services in main program, we have to declare composition root.
- Consists of implementation of Repositories and Unit Of Work with internal access, which can be changed easily,in the future so business logic wont get change, because the application layer work with abstractions.
- To register the repositories in main program we have to declare composition root.
- Uses the Register method from application layer and infrastructure layer.