public async Task <ActionResult <SupHeure> > PostSupHeure(SupHeure supHeure) { _context.supHeures.Add(supHeure); await _context.SaveChangesAsync(); return(CreatedAtAction("GetSupHeure", new { id = supHeure.Id }, supHeure)); }
public async Task <IActionResult> PutSupHeure(int id, SupHeure supHeure) { if (id != supHeure.Id) { return(BadRequest()); } _context.Entry(supHeure).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SupHeureExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }