How to wait until all tasks are finished before running code
I am trying to write a multi threading search and then display all the results once the tasks have finished running but currently I don't understand how to process the results once all the tasks are complete My code is as follows: private async void DoSearchAsync() { var productResults = await SearchProductsAsync(CoreCache.AllProducts); var brochureResults = await SearchBrochuresAsync(CoreCache.AllBrochures); _searchResults.AddRange(productResults); _searchResults.AddRange(brochureResults); ResultsCount = _searchResults.Count; } Where _searchResults is a List<SearchResult> My understanding is