public async Task <ActionResult <Liste_sh_crise> > PostListe_sh_crise(Liste_sh_crise liste_sh_crise) { _context.Liste_sh_crise.Add(liste_sh_crise); await _context.SaveChangesAsync(); return(CreatedAtAction("GetListe_sh_crise", new { id = liste_sh_crise.Id }, liste_sh_crise)); }
public async Task <IActionResult> PutListe_sh_crise(int id, Liste_sh_crise liste_sh_crise) { if (id != liste_sh_crise.Id) { return(BadRequest()); } _context.Entry(liste_sh_crise).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!Liste_sh_criseExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }