This is the summary post of the series. I would recommend you to read following posts first:
Patterns and Principles:
In the series, we implemented following patterns and principals:
You would like to read also:
General Steps after Core Implementation:
1. Create Model class
2. Create Repository class by inheriting GenericRepository class.
3. Create Service class by inheriting EntityService class.
4. Add new Controller and Views for CRUD and other operations
5. Create Test class for unit and other testing
If you are new to unit testing, see following:
1. Create Mock object of dependencies, arguments or properties.
2. Define/Implement the methods or properties of mock object which are being used in the method to be tested.
3. Call the method with Mock objects.
4. verify the result in the assert section.
Suppose you want to test a controller method then you have to mock the service layer and setup the service methods being used in the method.
Similarly, for testing service layer method, you have to mock repository layer.
In this series, we implemented
1. a sample on Repository and Unit of Work with IoC container.
2. To keep a clean separation of concerns.
3. To prevent direct queries on top of entity framework in service or web layer.
4. All layers are easy to test.
Enjoy Architecture !!