Exemple #1
0
        private void Initialized(object message)
        {
            message.Match()
            .With <AddMessageToChatCommand>(mes =>
            {
                var envelop = new ShardEnvelope(mes.Author.ToString(), new GetUserById(mes.Author));
                GetUserByIdResult contactUser = _userRegion.Ask <GetUserByIdResult>(envelop).Result;

                Guid messageId    = Guid.NewGuid();
                var messaegeAdded = new ChatMessageAddedEvent(messageId, mes.ChatId,
                                                              DateTime.UtcNow, mes.Message, new ChatParticipant(contactUser.Id, contactUser.Login, contactUser.UserName));
                Persist(messaegeAdded, UpdateState);
            });
        }
Exemple #2
0
 public void ChatMessageAdded(ChatMessageAddedEvent evt)
 {
     _userHubContext.Clients.Group(evt.ChatId.ToString()).chatMessageAdded(evt);
 }