public async Task <IActionResult> PutTbufferStop(short id, TbufferStop tbufferStop) { if (id != tbufferStop.TbufferStopId) { return(BadRequest()); } _context.Entry(tbufferStop).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TbufferStopExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <TbufferStop> > PostTbufferStop(TbufferStop tbufferStop) { _context.TbufferStop.Add(tbufferStop); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (TbufferStopExists(tbufferStop.TbufferStopId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetTbufferStop", new { id = tbufferStop.TbufferStopId }, tbufferStop)); }