public async Task <ActionResult <ButProjet> > PostButProjet(ButProjet butProjet) { _context.butProjets.Add(butProjet); await _context.SaveChangesAsync(); return(CreatedAtAction("GetButProjet", new { id = butProjet.Id }, butProjet)); }
public async Task <IActionResult> PutButProjet(int id, ButProjet butProjet) { if (id != butProjet.Id) { return(BadRequest()); } _context.Entry(butProjet).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ButProjetExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }