public async Task <ActionResult <CovidTesting> > PostCovidTesting(CovidTesting covidTesting) { _context.CovidTestings.Add(covidTesting); await _context.SaveChangesAsync(); return(CreatedAtAction("GetCovidTesting", new { id = covidTesting.Id }, covidTesting)); }
public async Task <IActionResult> PutCovidTesting(int id, CovidTesting covidTesting) { if (id != covidTesting.Id) { return(BadRequest()); } _context.Entry(covidTesting).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CovidTestingExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }