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());
        }
Пример #2
0
        public async Task <IEnumerable <CourseResponse> > GetCoursesAsync()
        {
            var result = await _courseRepository.GetAllAsync();

            return(result.Select(x => _courseMapper.Map(x)));
        }
Пример #3
0
 public List <CourseModel> GetStudentCourses()
 {
     return(_courseMapper.Map(_courseService.GetStudentCourses(UserId)));
 }