public async Task <IActionResult> PutSpirometerTestResult(int id, SpirometerTestResult spirometerTestResult) { if (id != spirometerTestResult.SpirometerTestResultId) { return(BadRequest()); } _context.Entry(spirometerTestResult).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SpirometerTestResultExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <SpirometerTestResult> > PostSpirometerTestResult(SpirometerTestResult spirometerTestResult) { _context.SpirometerTestResults.Add(spirometerTestResult); await _context.SaveChangesAsync(); return(CreatedAtAction("GetSpirometerTestResult", new { id = spirometerTestResult.SpirometerTestResultId }, spirometerTestResult)); }