public async Task <IActionResult> PutPosMsg(long id, PosMsg posMsg) { if (id != posMsg.Id) { return(BadRequest()); } _context.Entry(posMsg).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PosMsgExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <PosMsg> > PostPosMsg(PosMsg posMsg) { _context.PosMsg.Add(posMsg); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (PosMsgExists(posMsg.Id)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetPosMsg", new { id = posMsg.Id }, posMsg)); }