public async Task <ActionResult <Pitest> > PostPitest(Pitest pitest) { _context.Pitest.Add(pitest); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPitest", new { id = pitest.PitestId }, pitest)); }
public async Task <IActionResult> PutPitest(int id, Pitest pitest) { if (id != pitest.PitestId) { return(BadRequest()); } _context.Entry(pitest).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PitestExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }