Beispiel #1
0
        public static SubscriptionClient Create(ServiceBusEntityConnection topicConnection, string subscriptionName, ReceiveMode mode)
        {
            if (topicConnection == null)
            {
                throw Fx.Exception.Argument(nameof(topicConnection), "Namespace Connection is null. Create a connection using the NamespaceConnection class");
            }

            return(topicConnection.CreateSubscriptionClient(topicConnection.EntityPath, subscriptionName, mode));
        }
Beispiel #2
0
        public static SubscriptionClient CreateFromConnectionString(string topicEntityConnectionString, string subscriptionName, ReceiveMode mode)
        {
            if (string.IsNullOrWhiteSpace(topicEntityConnectionString))
            {
                throw Fx.Exception.ArgumentNullOrWhiteSpace(nameof(topicEntityConnectionString));
            }

            ServiceBusEntityConnection topicConnection = new ServiceBusEntityConnection(topicEntityConnectionString);

            return(topicConnection.CreateSubscriptionClient(topicConnection.EntityPath, subscriptionName, mode));
        }