public async Task <List <string> > HandleLink(string link, string rootFolder) { Console.WriteLine($"Handling link: {link}"); var links = new List <string>(); var document = _client.Get(link, "tretton"); await document.ContinueWith(antecedent => { links = GetLinks(antecedent.Result); var folderPath = _fileHandler.CreateFolderPath(link, rootFolder); var fileName = _fileHandler.CreateFileName(folderPath); Directory.CreateDirectory(folderPath); _fileHandler.CreateAndWriteAsync(antecedent.Result, folderPath, fileName); }); await Task.WhenAll(document); return(links); }