public async Task <ActionResult <Entente> > PostEntente(Entente entente) { _context.Ententes.Add(entente); await _context.SaveChangesAsync(); return(CreatedAtAction("GetEntente", new { id = entente.EntenteID }, entente)); }
public async Task <IActionResult> PutEntente(int id, Entente entente) { if (id != entente.EntenteID) { return(BadRequest()); } _context.Entry(entente).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EntenteExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }