public async Task <ActionResult <MsgInterne> > PostMsgInterne(MsgInterne msgInterne) { _context.msgInternes.Add(msgInterne); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMsgInterne", new { id = msgInterne.Id }, msgInterne)); }
public async Task <IActionResult> PutMsgInterne(int id, MsgInterne msgInterne) { if (id != msgInterne.Id) { return(BadRequest()); } _context.Entry(msgInterne).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MsgInterneExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }