コード例 #1
0
        private Uri buildUri(bool forReply)
        {
            var list = new List <string>();

            if (QueueName.IsNotEmpty())
            {
                list.Add(Queue);
                list.Add(QueueName.ToLowerInvariant());
            }
            else
            {
                // Don't put the subscription in reply Uri
                if (!forReply && SubscriptionName.IsNotEmpty())
                {
                    list.Add(Subscription);
                    list.Add(SubscriptionName.ToLowerInvariant());
                }

                if (TopicName.IsNotEmpty())
                {
                    list.Add(Topic);
                    list.Add(TopicName.ToLowerInvariant());
                }
            }

            if (forReply && Mode == EndpointMode.Durable)
            {
                list.Add(TransportConstants.Durable);
            }


            var uri = $"{AzureServiceBusTransport.ProtocolName}://{list.Join("/")}".ToUri();

            return(uri);
        }