public JsonResult PostChatMessage(string userToken, string roomToken, string message) { if (userToken.IsEmpty() || message.IsEmpty() || roomToken.IsEmpty()) return Json(false); var chat = new Chat { Message = message.GetValidatedString(), SentBy = userToken, SentAt = DateTime.Now, RoomToken = roomToken }; _db.Chats.InsertOnSubmit(chat); var room = _db.Rooms.FirstOrDefault(r => r.Token == roomToken); if (room != null) room.LastUpdated = DateTime.Now; _db.SubmitChanges(); return Json(true); }
partial void UpdateChat(Chat instance);
partial void DeleteChat(Chat instance);
partial void InsertChat(Chat instance);