public async Task <ActionResult <PiecesJointesTr> > PostPiecesJointesTr(PiecesJointesTr piecesJointesTr) { _context.piecesJointesTrs.Add(piecesJointesTr); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPiecesJointesTr", new { id = piecesJointesTr.Id }, piecesJointesTr)); }
public async Task <IActionResult> PutPiecesJointesTr(int id, PiecesJointesTr piecesJointesTr) { if (id != piecesJointesTr.Id) { return(BadRequest()); } _context.Entry(piecesJointesTr).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PiecesJointesTrExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }