Beispiel #1
0
        public static async Task <ILogsProcessorBuilder> AddToSearchIndexAsync <TEventDto>(
            this ILogsProcessorBuilder processorBuilder,
            IAzureSearchService azureSearchService,
            string indexName,
            Predicate <EventLog <TEventDto> > predicate = null) where TEventDto : class, new()
        {
            var indexer = await azureSearchService.CreateEventIndexer <TEventDto>(indexName).ConfigureAwait(false);

            processorBuilder.DisposeOnProcessorDisposing(indexer);
            return(processorBuilder.AddToSearchIndex(indexer, predicate: predicate));
        }
Beispiel #2
0
        public static async Task <ILogsProcessorBuilder> AddToSearchIndexAsync <TEventDto, TSearchDocument>(
            this ILogsProcessorBuilder processorBuilder,
            IAzureSearchService azureSearchService,
            Index azureIndex,
            Func <EventLog <TEventDto>, TSearchDocument> mappingFunc,
            Predicate <EventLog <TEventDto> > predicate = null) where TEventDto : class, new() where TSearchDocument : class, new()
        {
            var indexer = await azureSearchService.CreateEventIndexer(azureIndex, mappingFunc).ConfigureAwait(false);

            processorBuilder.DisposeOnProcessorDisposing(indexer);
            return(processorBuilder.AddToSearchIndex(indexer, predicate));
        }