public async Task <ActionResult <CompteBen> > PostCompteBen(CompteBen compteBen) { _context.compteBens.Add(compteBen); await _context.SaveChangesAsync(); return(CreatedAtAction("GetCompteBen", new { id = compteBen.Id }, compteBen)); }
public async Task <IActionResult> PutCompteBen(int id, CompteBen compteBen) { if (id != compteBen.Id) { return(BadRequest()); } _context.Entry(compteBen).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CompteBenExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }