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