public async Task <IActionResult> Students(int id) { var userId = _userManager.GetUserId(this.User); if (!await _trainerService.IsTrainer(id, userId)) { return(NotFound()); } var studentsInCourseViewModel = new StudentsInCourseViewModel { Students = await _trainerService.StudentsInCourseAsync(id), Course = await _courseService.ByIdAsync <CourseListingServiceModel>(id) }; return(View(studentsInCourseViewModel)); }
public async Task <IActionResult> Students(int id) { var userId = userManger.GetUserId(User); if (!await trainers.IsTrainer(id, userId)) { return(NotFound()); } var students = await trainers.StudentsInCourseAsync(id); var course = await courses.ByIdAsync <CourseListingServiceModel>(id); return(View(new StudentsInCourseViewModel { Students = students, Course = course })); }