public async Task <ActionResult <PiecesJointesRc> > PostPiecesJointesRc(PiecesJointesRc piecesJointesRc) { _context.piecesJointesRcs.Add(piecesJointesRc); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPiecesJointesRc", new { id = piecesJointesRc.Id }, piecesJointesRc)); }
public async Task <IActionResult> PutPiecesJointesRc(int id, PiecesJointesRc piecesJointesRc) { if (id != piecesJointesRc.Id) { return(BadRequest()); } _context.Entry(piecesJointesRc).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PiecesJointesRcExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }