public Teachers GetTeacherById(int entityToGetById) { ITeachersRepository repo = new TeachersRepository(getEntities()); Entities.Teachers returnedValue = repo.GetById(entityToGetById); Teachers returnedValue2 = Mapper.Map <Entities.Teachers, Teachers>(returnedValue); return(returnedValue2); }
// GET: Teachers/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Teacher teacher = teachersRepo.GetById(id.Value); if (teacher == null) { return(HttpNotFound()); } var teacherVM = TeacherMap.TeacherToTeacherVM(teacher); return(View(teacherVM)); }