//This constructor is used by unit tests. They pass a test double context public ProductController(IWebStoreContext context) { //Use the context passed to the constructor _context = context; }
public GenericRepository(IWebStoreContext context) { this._context = context; }
//The parameterless version of the constructor is used by the MVC controller factory public ProductController() { //Instantiate an actual Entity Framework context _context = new RealWebStoreContext(); }