public async Task <IActionResult> PutTclearanceGaugeType(long id, TclearanceGaugeType tclearanceGaugeType) { if (id != tclearanceGaugeType.TclearanceGaugeTypeId) { return(BadRequest()); } _context.Entry(tclearanceGaugeType).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TclearanceGaugeTypeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <TclearanceGaugeType> > PostTclearanceGaugeType(TclearanceGaugeType tclearanceGaugeType) { _context.TclearanceGaugeType.Add(tclearanceGaugeType); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (TclearanceGaugeTypeExists(tclearanceGaugeType.TclearanceGaugeTypeId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetTclearanceGaugeType", new { id = tclearanceGaugeType.TclearanceGaugeTypeId }, tclearanceGaugeType)); }