public async Task <List <CourseDto> > GetAvailableCoursesForStudent(Guid studentId) { var student = await studentService.GetStudentById(studentId); return(await readRepository.GetAll <Domain.Entities.Course>() .Where(c => c.Year <= student.YearOfStudy) .Select(course => courseMapper.Map(course)).ToListAsync()); }
public async Task <IEnumerable <CourseResponse> > GetCoursesAsync() { var result = await _courseRepository.GetAllAsync(); return(result.Select(x => _courseMapper.Map(x))); }
public List <CourseModel> GetStudentCourses() { return(_courseMapper.Map(_courseService.GetStudentCourses(UserId))); }