public AzureStorageBackedStateManager(ILogger <IStateManager <T> > logger,
                                              IOptions <AzureStorageBackedConfig <AzureStorageBackedStateManager <T> > > options,
                                              AzureStorageBackedConfigValidator <AzureStorageBackedStateManager <T> > storageBackedConfigValidator)
            : base(logger)
        {
            _logger = logger ?? throw new ArgumentNullException(nameof(logger));
            _storageBackedConfig = options?.Value ??
                                   throw new ArgumentNullException(nameof(options));
            _storageBackedConfigValidator = storageBackedConfigValidator ??
                                            throw new ArgumentNullException(nameof(storageBackedConfigValidator));

            _storageBackedConfigValidator.ValidateAndThrow(_storageBackedConfig);

            _blobServiceClient = new BlobServiceClient(_storageBackedConfig.ConnectionString);
        }
示例#2
0
        public AzureStorageBackedInstalledAppManager(ILogger <IInstalledAppManager> logger,
                                                     ISmartThingsAPIHelper smartThingsAPIHelper,
                                                     IOptions <AzureStorageBackedConfig <AzureStorageBackedInstalledAppManager> > options,
                                                     AzureStorageBackedConfigValidator <AzureStorageBackedInstalledAppManager> storageBackedConfigValidator)
            : base(logger, smartThingsAPIHelper)
        {
            _logger = logger ??
                      throw new ArgumentNullException(nameof(logger));
            _storageBackedConfig = options?.Value ??
                                   throw new ArgumentNullException(nameof(options));
            _storageBackedConfigValidator = storageBackedConfigValidator ??
                                            throw new ArgumentNullException(nameof(storageBackedConfigValidator));

            _storageBackedConfigValidator.ValidateAndThrow(_storageBackedConfig);

            _blobServiceClient = new BlobServiceClient(_storageBackedConfig.ConnectionString);
        }