public async Task <ActionResult <DemandeSupHeure> > PostDemandeSupHeure(DemandeSupHeure demandeSupHeure) { _context.demandeSupHeures.Add(demandeSupHeure); await _context.SaveChangesAsync(); return(CreatedAtAction("GetDemandeSupHeure", new { id = demandeSupHeure.Id }, demandeSupHeure)); }
public async Task <IActionResult> PutDemandeSupHeure(int id, DemandeSupHeure demandeSupHeure) { if (id != demandeSupHeure.Id) { return(BadRequest()); } _context.Entry(demandeSupHeure).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!DemandeSupHeureExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }