Esempio n. 1
0
        public async Task SendMessage(SendMessageRequest request)
        {
            var newMessage = _chatMessageService.CreateChatMessage(request.SenderUserId, request.RoomId, request.Text);

            if (newMessage == null)
            {
                return;
            }

            var result = _mapper.Map <ChatMessageModel>(newMessage);

            await this.Clients.Group(newMessage.ChatRoomId.ToString()).NewChatMessage(result);
        }