public ActionResult AddMessage( string messageText ) { if (messageText == "") return Json( new { result = "error" }, JsonRequestBehavior.AllowGet ); var chatMessage = new ChatMessage(); chatMessage.id = Guid.NewGuid(); chatMessage.texted_at = DateTime.UtcNow; chatMessage.author_id = chatRepository.GetAuthorId( User.Identity.Name ); chatMessage.is_deleted = false; chatMessage.text = messageText; chatRepository.Add( chatMessage ); return Json( new { result = "ok", authorName = User.Identity.Name, text = messageText }, JsonRequestBehavior.AllowGet ); }
public void Delete( ChatMessage chatMessage ) { _db.ChatMessages.DeleteOnSubmit( chatMessage ); Save(); }
public void Add( ChatMessage chatMessage ) { _db.ChatMessages.InsertOnSubmit( chatMessage ); Save(); }
private void detach_ChatMessages(ChatMessage entity) { this.SendPropertyChanging(); entity.ChatUser = null; }
partial void DeleteChatMessage(ChatMessage instance);
partial void UpdateChatMessage(ChatMessage instance);
partial void InsertChatMessage(ChatMessage instance);