public static async Task BroadcastMessage(this ISimpleChatClient client, SimpleChatClientSendMessage clientSendMessage)
        {
            SimpleChatClientReceiveMessage clientReceiveMessage = new SimpleChatClientReceiveMessage
            {
                UserId         = clientSendMessage.UserId,
                Message        = clientSendMessage.Message,
                DateTimeString = DateTime.Now.ToString()
            };

            await client.ClientReceiveMessage(clientReceiveMessage);
        }
Пример #2
0
 /// <summary>
 /// Broadcasts the message.
 /// </summary>
 public async Task ClientSendMessage(SimpleChatClientSendMessage clientSendMessage)
 {
     await Clients.Group(GroupName).BroadcastMessage(clientSendMessage);
 }