public async Task <IActionResult> PutTcurve(long id, Tcurve tcurve) { if (id != tcurve.TcurveId) { return(BadRequest()); } _context.Entry(tcurve).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TcurveExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <Tcurve> > PostTcurve(Tcurve tcurve) { _context.Tcurve.Add(tcurve); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (TcurveExists(tcurve.TcurveId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetTcurve", new { id = tcurve.TcurveId }, tcurve)); }