public async Task <IActionResult> PutChats(int id, Chats chats) { if (id != chats.Id) { return(BadRequest()); } _context.Entry(chats).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ChatsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }