Beispiel #1
0
 public IActionResult Put(int id, [FromBody] RequestUpdateExam _exam)
 {
     if (id != _exam.Id)
     {
         return(NotFound());
     }
     if (ModelState.IsValid)
     {
         Exam exa    = _examServices.GetExamById(_exam.Id);
         Exam entity = _examServices.UpdateExam(_exam.CopyTo(exa));
         _examServices.Commit();
         return(Ok(entity));
     }
     else
     {
         return(BadRequest());
     }
 }