コード例 #1
0
        public Task Handle(OrderReceivedEvent message)
        {
            if (message == null)
            {
                throw new ArgumentNullException(nameof(message));
            }

            var notifier = _connectionManager.GetHubContext <SecuredHub>();
            var lst      = new[] { message.Client, message.Seller };

            lst.Distinct();
            var connectionIds = new List <string>();

            foreach (var r in lst)
            {
                connectionIds.AddRange(SecuredHub.Connections.GetConnections(r).ToList());
            }

            notifier.Clients.Clients(connectionIds).orderReceived(_responseBuilder.GetOrderReceivedEvent(message));
            return(Task.FromResult(0));
        }