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