예제 #1
0
        public UpdateOwnersCommand(
            IDatabaseAuxiliaryDataFetcher databaseFetcher,
            IOwnerDataClient ownerDataClient,
            IDataSetComparer ownerSetComparer,
            ISearchDocumentBuilder searchDocumentBuilder,
            ISearchIndexActionBuilder indexActionBuilder,
            Func <IBatchPusher> batchPusherFactory,
            IOptionsSnapshot <AzureSearchJobConfiguration> options,
            IAzureSearchTelemetryService telemetryService,
            ILogger <UpdateOwnersCommand> logger)
        {
            _databaseFetcher          = databaseFetcher ?? throw new ArgumentNullException(nameof(databaseFetcher));
            _ownerDataClient          = ownerDataClient ?? throw new ArgumentNullException(nameof(ownerDataClient));
            _ownerSetComparer         = ownerSetComparer ?? throw new ArgumentNullException(nameof(ownerSetComparer));
            _searchDocumentBuilder    = searchDocumentBuilder ?? throw new ArgumentNullException(nameof(searchDocumentBuilder));
            _searchIndexActionBuilder = indexActionBuilder ?? throw new ArgumentNullException(nameof(indexActionBuilder));
            _batchPusherFactory       = batchPusherFactory ?? throw new ArgumentNullException(nameof(batchPusherFactory));
            _options          = options ?? throw new ArgumentNullException(nameof(options));
            _telemetryService = telemetryService ?? throw new ArgumentNullException(nameof(telemetryService));
            _logger           = logger ?? throw new ArgumentNullException(nameof(logger));

            if (_options.Value.MaxConcurrentBatches <= 0)
            {
                throw new ArgumentOutOfRangeException(
                          nameof(options),
                          $"The {nameof(AzureSearchJobConfiguration.MaxConcurrentBatches)} must be greater than zero.");
            }
        }
예제 #2
0
 public DownloadTransferrer(
     IDataSetComparer dataComparer,
     IOptionsSnapshot <AzureSearchJobConfiguration> options,
     ILogger <DownloadTransferrer> logger)
 {
     _dataComparer = dataComparer ?? throw new ArgumentNullException(nameof(dataComparer));
     _options      = options ?? throw new ArgumentNullException(nameof(options));
     _logger       = logger ?? throw new ArgumentNullException(nameof(logger));
 }