So I know Task.Run basically makes the code run in a new thread from the thread pool. But what is the difference if I do something like this:
var tasks = new List<string>(){ "foo", "bar" }
.Select(e => Task.Run(async () => await Process(e)))
.ToList();
await Task.WhenAll(tasks);
vs
var tasks = new List<string>(){ "foo", "bar" }
.Select(async e => await Process(e))
.ToList();
await Task.WhenAll(tasks);
My understanding would be that the second snippet only runs one at a time while it awaits some async process, and the first one actually runs them in parallel on threads from the thread pool?