コード例 #1
0
        private async Task <List <string> > LoadWatchWordsAsync(IWatchWordsRepository watchWordsRepository)
        {
            var watchWords = await watchWordsRepository.GetAllAsync();

            var result = watchWords
                         .Select(ww => ww.Word)
                         .ToList();

            return(result);
        }
コード例 #2
0
        private async Task <List <string> > FindWatchWordMatchesAsync(IWatchWordsRepository watchWordsRepository, List <string> words)
        {
            var watchWords = await GetWatchWordsAsync(watchWordsRepository);

            var matches = watchWords
                          .Intersect(words)
                          .ToList();

            return(matches);
        }
コード例 #3
0
        private async Task <List <string> > GetWatchWordsAsync(IWatchWordsRepository watchWordsRepository)
        {
            var watchWords = await _watchWordsLazy.GetValueAsync(() => LoadWatchWordsAsync(watchWordsRepository));

            return(watchWords);
        }
コード例 #4
0
 public TextProcessingDataContext(IDbContextFactory <UniqueWordsDbContext> dbContextFactory)
     : base(dbContextFactory)
 {
     WordsRepository      = new WordsRepository(DbContext);
     WatchWordsRepository = new WatchWordsRepository(DbContext);
 }