I have the following class which is named Pluck:
internal static void Work()
{
Task[] tasks = new Task[5];
for (int i = 0; i < tasks.Length; i++)
{
tasks[i] = SumAsync();
}
Task.WhenAll(tasks);
}
private static async Task<int> SumAsync()
{
return await Task.Run(() => { return OnePlusOne(); });
}
private static int OnePlusOne()
{ return 1+1; }
And my main method:
static void Main(string[] args)
{
Pluck.Work();
}
I am missing something because I toggle a breakpoint within OnePlusOne
and never gets hit.