public async Task <ActionResult> Enroll(int id) { await _courseService.AddStudentAsync(id, User.Identity.GetUserId()); if (User.IsInRole(Constants.RoleInstructor)) { return(RedirectToRoute("InstructorDetails", new { id })); } else { return(RedirectToRoute("StudentDetails", new { id })); } }