public ActionResult Chat(string berricht, int id) //id is de ontvanger(het contact) { Account acc = (Account)Session["loggedin_account"]; ChatMessage message = new ChatMessage(berricht, DateTime.Now, acc.Id, id); if (ModelState.IsValid) { chatMessageRepository.AddMessage(message); } return(RedirectToAction("Chat")); }
public async Task <ChatMessage> CreateNewMessage(string senderName, string message) { var chatMessage = new ChatMessage(Guid.NewGuid()) { Sender = senderName, Message = message }; await _repository.AddMessage(chatMessage); return(chatMessage); }
public ChatMessage CreateNewMessage(string senderName, string message) { var chatMessage = new ChatMessage(Guid.NewGuid()) { Sender = senderName, Message = message }; _repository.AddMessage(chatMessage); return(chatMessage); }