Beispiel #1
0
 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));
     }
 }
Beispiel #2
0
 public IActionResult Create([FromBody] GroupTeacherViewModel model)
 {
     try
     {
         _services.GroupTeachersService.Create(model);
         return(Created("", new object()));
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }
Beispiel #3
0
 public void Update(int id, GroupTeacherViewModel model)
 {
     _repo.GroupTeachersRepo.Update(id, new GroupTeacher {
         GroupID = model.GroupID, TeacherID = model.TeacherID
     });
 }
Beispiel #4
0
 public void Create(GroupTeacherViewModel model)
 {
     _repo.GroupTeachersRepo.Create(new GroupTeacher {
         GroupID = model.GroupID, TeacherID = model.TeacherID
     });
 }