public async Task <IActionResult> PutTgaugeChange(short id, TgaugeChange tgaugeChange) { if (id != tgaugeChange.TgaugeChangeId) { return(BadRequest()); } _context.Entry(tgaugeChange).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TgaugeChangeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <TgaugeChange> > PostTgaugeChange(TgaugeChange tgaugeChange) { _context.TgaugeChange.Add(tgaugeChange); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (TgaugeChangeExists(tgaugeChange.TgaugeChangeId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetTgaugeChange", new { id = tgaugeChange.TgaugeChangeId }, tgaugeChange)); }