public async Task <ActionResult> Delete(Assignment model) { await _assignmentService.DeleteAsync(model); if (User.IsInRole(Constants.RoleInstructor)) { return(RedirectToRoute("InstructorDetails", new { id = model.CourseId })); } else { return(RedirectToRoute("StudentDetails", new { id = model.CourseId })); } }