public async Task <ActionResult <Chatdetalle> > PostChatdetalle(Chatdetalle chatdetalle) { _context.Chatdetalle.Add(chatdetalle); await _context.SaveChangesAsync(); return(CreatedAtAction("GetChatdetalle", new { id = chatdetalle.Chatdetalleid }, chatdetalle)); }
public async Task <IActionResult> PutChatdetalle(int id, Chatdetalle chatdetalle) { if (id != chatdetalle.Chatdetalleid) { return(BadRequest()); } _context.Entry(chatdetalle).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ChatdetalleExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }