public async Task <IActionResult> PutConfIntervention([FromRoute] int id, [FromBody] ConfIntervention confIntervention) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != confIntervention.Recid) { return(BadRequest()); } _context.Entry(confIntervention).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ConfInterventionExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostConfIntervention([FromBody] ConfIntervention confIntervention) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.ConfIntervention.Add(confIntervention); await _context.SaveChangesAsync(); return(CreatedAtAction("GetConfIntervention", new { id = confIntervention.Recid }, confIntervention)); }