Esempio n. 1
0
        public ActionResult <IList <ProfessorViewModel> > Get([FromRoute] string name)
        {
            var professors = ProfessorRepository.GetProfessorWithCourseInfoByName(name);

            if (professors == null)
            {
                return(NotFound());
            }

            var listOfProfessor = professors.Select(p => Mapper.Map <Professor, ProfessorViewModel>(p)).ToList();

            return(Ok(listOfProfessor));
        }