public ActionResult Edit(int?id, string text) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ChatMessage chatMessage = chatMessageManager.Find(x => x.Id == id); if (chatMessage == null) { return(new HttpNotFoundResult()); } chatMessage.Messages = text; if (chatMessageManager.Update(chatMessage) > 0) { return(Json(new { result = true }, JsonRequestBehavior.AllowGet)); } return(Json(new { result = false }, JsonRequestBehavior.AllowGet)); }