Example #1
0
        public async Task SendMessage(MessageViewModel message)
        {
            await Clients.Group(message.ChatId.ToString()).SendAsync("receiveMessage", message);

            await _chatService.AddMessagesAsync(message.ChatId,
                                                new List <MessageModel>() { _mapper.Map <MessageModel>(message) });

            //TODO: Create cache for sending message
        }