Пример #1
0
        public TopicClient(INamespaceManager <T> namespaceManager,
                           ISerializationProvider serializationProvider,
                           ILogger <ClientBase <T> > logger,
                           IEnumerable <IMessageExtension <T> > extensions)
            : base(serializationProvider, logger)
        {
            if (namespaceManager == null)
            {
                throw new ArgumentNullException(nameof(namespaceManager));
            }

            if (extensions == null)
            {
                throw new ArgumentNullException(nameof(extensions));
            }

            _extensions = extensions.ToArray();
            _client     = new AwaitableLazy <AzureClient>(async() =>
            {
                await namespaceManager.ProvisionTopicAsync();
                return(namespaceManager.CreateTopicClient());
            });
        }