December 2019
Intermediate to advanced
528 pages
11h 19m
English
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 will take us to the list of work items. Let's wire-up a call to AddWorkItem:
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 ...