public void AddMessage(Message model) { // The user that sent the message model.User = _chatRepository.GetUser(model.UserId); model.Date = DateTime.UtcNow; var id = _chatRepository.AddMessage(model); model.Id = id; ChatHub.AddMessage(model.RoomId.ToString(), model); }