Example #1
0
        public IHttpActionResult GetLecturer(int id)
        {
            Lecturer Lecturer = (Lecturer)lecturerRepo.Find(id);

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

            Mapper.Initialize(c => c.CreateMap <Lecturer, LecturerDTO>());

            LecturerDTO LecturerDTO = Mapper.Map <LecturerDTO>(Lecturer);

            return(Ok(LecturerDTO));
        }