Ejemplo n.º 1
0
        private async Task AddNewWordsAsync(IWordsRepository wordsRepository, List <string> words)
        {
            var skip = 0;
            var take = 100;
            var n    = words.Count;

            while (skip < n)
            {
                var wordsPart = words
                                .Skip(skip)
                                .Take(take)
                                .ToList();

                await wordsRepository.TryAddNewWordsWithNoSyncAsync(wordsPart);

                skip += take;
            }
        }