public async Task <ActionResult> DeleteAsync(int id) { var item = await userTask.GetTaskId(id); if (item == null) { TempData["Error"] = "The item does not exist!"; } else { await userTask.DeleteTask(item); TempData["Success"] = "The item has been deleted!"; } return(RedirectToAction("Index")); }