public async Task <IActionResult> Cancel(int id) { string user = User.FindFirst("Index").Value; var Currentuser = await _taskRepository.GetCurrentUser(user); ViewBag.photo = Currentuser.PhotoURL; bool success = await _taskRepository.CancelAddingTask(id); if (success) { return(RedirectToAction(nameof(TimeSheet))); } return(RedirectToAction(nameof(TimeSheet))); }