Exemplo n.º 1
0
        public TeacherModel Get(Guid id)
        {
            var teacher = _teachersService.Get(id);

            return(teacher == null ? null : new TeacherModel
            {
                Id = teacher.Id,
                Name = teacher.Name
            });
        }
        public IHttpActionResult GetAll()
        {
            IEnumerable <Teacher> teachers;

            try
            {
                teachers = db.Get();
            }
            catch (NullReferenceException e)
            {
                logger.Error(e.Message);
                return(NotFound());
            }
            logger.Info("Requesting teachers");
            return(Ok(teachers));
        }
Exemplo n.º 3
0
 public IHttpActionResult GetAllTeachers()
 {
     return(Ok(teachersService.Get()));
 }