The last thing we need to do before we can run our application is to modify the HomeController class to work with the IWorkItemService:
- Modify the constructor and the Index action as follows:
private readonly IWorkItemService _workItemService; public HomeController(IWorkItemService workItemService) { _workItemService = workItemService; } public IActionResult Index() { var workItems = _workItemService.GetAllWorkItems(); return View(workItems); }
- We are getting all the work items in the MongoDB database and passing them to the view for the model to work with.
- When you are ...