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)); }
public IHttpActionResult GetAllTeachers() { return(Ok(teachersService.Get())); }