Redirecting to the list of work items

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:

  1. 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 ...

Get C# 7 and .NET Core 2.0 Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.