Check out example codes for "C# foreach loop async but wait at end". It will help you in understanding the concepts better.

Code Example 1

public async Task RunAsync()
{
    var tasks = new List<Task>();
 
    foreach (var x in new[] { 1, 2, 3 })
    {
        var task = DoSomethingAsync(x);
        tasks.Add(task);
    }
 
    await Task.WhenAll();
}

Learn ReactJs, React Native from akashmittal.com