Now it’s time to create a MockRepository that inherits from the interface it’s method. Inside the constructor we create some mockdata with orders. Now in the method GetAllOrders return the list of orders. Next let’s create a controller that implements the Order interface repository.
Now inside the Startup.cs of the MVC app tell the app that any time someone asks for IEmployeerepository it provides the mock repository. So the power of a repository is now that any time you want to change the source data you can just change this one line of code with another repository. Now in […]