Пример #1
0
        public async Task <ActionResult <IEnumerable <ProfessionDto> > > GetProfessionsForAcademy(Guid academyId)
        {
            var professions = await _professionRepository.GetProfessionForAcademyAsync(academyId);

            foreach (var professin in professions)
            {
                professin.Academy = await _academyRepository.GetAcademyAsync(professin.AcademyId);
            }
            var professionDtos = _mapper.Map <IEnumerable <ProfessionDto> >(professions);

            return(Ok(professionDtos));
        }