public async Task <ActionResult <WeightTestResult> > PostWeightTestResult(WeightTestResult weightTestResult) { _context.WeightTestResults.Add(weightTestResult); await _context.SaveChangesAsync(); return(CreatedAtAction("GetWeightTestResult", new { id = weightTestResult.WeightTestResultId }, weightTestResult)); }
public async Task <IActionResult> PutWeightTestResult(int id, WeightTestResult weightTestResult) { if (id != weightTestResult.WeightTestResultId) { return(BadRequest()); } _context.Entry(weightTestResult).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!WeightTestResultExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }