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());
        }
Esempio n. 2
0
        public async Task <IEnumerable <CourseResponse> > GetCoursesAsync()
        {
            var result = await _courseRepository.GetAllAsync();

            return(result.Select(x => _courseMapper.Map(x)));
        }
Esempio n. 3
0
 public List <CourseModel> GetStudentCourses()
 {
     return(_courseMapper.Map(_courseService.GetStudentCourses(UserId)));
 }