public IActionResult Update([FromRoute] int id, [FromBody] GroupTeacherViewModel model) { try { _services.GroupTeachersService.Update(id, model); return(Ok(new object())); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public IActionResult Create([FromBody] GroupTeacherViewModel model) { try { _services.GroupTeachersService.Create(model); return(Created("", new object())); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public void Update(int id, GroupTeacherViewModel model) { _repo.GroupTeachersRepo.Update(id, new GroupTeacher { GroupID = model.GroupID, TeacherID = model.TeacherID }); }
public void Create(GroupTeacherViewModel model) { _repo.GroupTeachersRepo.Create(new GroupTeacher { GroupID = model.GroupID, TeacherID = model.TeacherID }); }