public async Task <ActionResult <PiecesJointes> > PostPiecesJointes(PiecesJointes piecesJointes) { _context.piecesJointes.Add(piecesJointes); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPiecesJointes", new { id = piecesJointes.Id }, piecesJointes)); }
public async Task <IActionResult> PutPiecesJointes(int id, PiecesJointes piecesJointes) { if (id != piecesJointes.Id) { return(BadRequest()); } _context.Entry(piecesJointes).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PiecesJointesExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }