public async Task <IActionResult> PutCave([FromRoute] int id, [FromBody] Cave cave) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != cave.Id) { return(BadRequest()); } _context.Entry(cave).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CaveExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutUtilisateur([FromRoute] Guid id, [FromBody] Utilisateur utilisateur) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != utilisateur.Id) { return(BadRequest()); } _context.Entry(utilisateur).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UtilisateurExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }