public async Task ImportSeries(string title) { await IsSeriesImported(title); var parsers = new List <IParser> { _tvMazeParser, _tmdbParser }; var allSeries = new List <InternalSeries>(); var importTaskList = new List <Task <InternalSeries> >(); foreach (var parser in parsers) { importTaskList.Add(parser.ImportSeries(title)); } var sw = new Stopwatch(); sw.Start(); Task.WaitAll(importTaskList.ToArray()); sw.Stop(); Console.WriteLine($"Gather took {sw.ElapsedMilliseconds} milliseconds."); foreach (var importTask in importTaskList) { allSeries.Add(importTask.Result); } if (allSeries.Count >= 2) { for (int i = 0; i < allSeries.Count - 1; i++) { allSeries.First().Merge(allSeries[i + 1]); } } await _seriesRepository.AddInternalSeries(allSeries.FirstOrDefault()); }