Another interesting thing to note is that after we call the InsertWorkItem method on the WorkItemService, we redirect the view to the Index action on the HomeController. As we already know, this we know will take us to the list of work items:
- Speaking of HomeController, modify the code there to add another action called AddWorkItem that calls the AddItem action on the AddWorkItemController class:
public ActionResult AddWorkItem() { return RedirectToAction("AddItem", "AddWorkItem"); } Your HomeController code will now look as follows: private readonly IWorkItemService _workItemService; public HomeController(IWorkItemService workItemService) { _workItemService = workItemService; } public IActionResult ...