public async Task <ActionResult <FactIntervention> > PostFactIntervention(FactIntervention factIntervention) { _context.FactInterventions.Add(factIntervention); await _context.SaveChangesAsync(); return(CreatedAtAction("GetFactIntervention", new { id = factIntervention.Id }, factIntervention)); }
public async Task <IActionResult> PutFactIntervention(long id, FactIntervention factIntervention) { if (id != factIntervention.Id) { return(BadRequest()); } _context.Entry(factIntervention).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FactInterventionExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }