Пример #1
0
 public void PutEleve(int id, Eleve eleve)
 {
     eleve.Id = id;
     if (!repository.Update(eleve))
     {
         throw new HttpResponseException(HttpStatusCode.NotFound);
     }
 }
Пример #2
0
 public async Task <IActionResult> PutEleve(int id, EleveViewModel eleve)
 {
     try
     {
         var p = _mapper.Map <Eleve>(eleve);
         p.Id = id;
         _eleveRepository.Update(p);
         await _eleveRepository.SaveAsync();
     }
     catch (DbUpdateConcurrencyException)
     {
         throw;
     }
     return(NoContent());
 }