public async Task <ActionResult <IEnumerable <SubjectDto> > > GetSubjecs(Guid studentId) { if (string.IsNullOrEmpty(studentId.ToString())) { return(NotFound()); } var student = await _repository.GetStudentAsync(studentId); if (student == null) { return(BadRequest()); } if (student?.Group == null) { return(BadRequest()); } var subjects = await _repository.GetSubjectsForStudentAsync(student.Id); var subjectsDtos = subjects.Select(s => _mapper.Map <SubjectDto>(s)).ToList(); return(subjectsDtos); }