예제 #1
0
        public static void EnsureValid(this AzureSearchOptions options)
        {
            if (options == null)
            {
                CoreOptionsExtensions.ThrowMissingConfiguration(nameof(BaGetOptions.Search));
            }

            if (string.IsNullOrEmpty(options.AccountName))
            {
                CoreOptionsExtensions.ThrowMissingConfiguration(
                    nameof(BaGetOptions.Search),
                    nameof(AzureSearchOptions.AccountName));
            }

            if (string.IsNullOrEmpty(options.AccountName))
            {
                CoreOptionsExtensions.ThrowMissingConfiguration(
                    nameof(BaGetOptions.Search),
                    nameof(AzureSearchOptions.ApiKey));
            }
        }
예제 #2
0
 public AzureSearchMockData(IOptions <SearchOptions> azureSearchOptions, NewsContext context)
 {
     _context            = context;
     _azureSearchOptions = azureSearchOptions.Value.AzureSearch;
 }
 public AzureSearchService(IOptions <AzureSearchOptions> options, IMapper mapper)
 {
     _options = options.Value;
     _mapper  = mapper;
 }
 private static SearchIndexClient CreateClient(AzureSearchOptions options)
 {
     return(new SearchIndexClient(options.SearchServiceName, options.IndexName, new SearchCredentials(options.SearchServiceQueryApiKey)));
 }
예제 #5
0
 public AzureSearchService(IOptions <DevnotOptions> azureSearchOptions)
 {
     _azureSearchOptions = azureSearchOptions.Value.SearchEngine.AzureSearch;
 }
예제 #6
0
 public AzureSearchIndexer(IOptions <AzureSearchOptions> options, IMapper mapper)
 {
     _options = options.Value;
     _mapper  = mapper;
 }