Something important to note is that code like this:
var a = await AlphaAsync();
var b = await BetaAsync();
var g = await GammaAsync();
will be slower than the equivalent synchronous code. It does the same work, in the same order, and will not run any part in parallel. It can theoretically scale to more concurrent connections and in-flight requests, but I had a tough time achieving a measurable benefit even in benchmark tests.To get things running in parallel, the tasks have to be started but not immediately awaited:
var ta = AlphaAsync();
var tb = BetaAsync();
var tg = GammaAsync();
...
var a = await ta; var b = await tb; var g = await tg;
I've only ever seen this turn up in real code maybe once or twice. People just don't do it, and the samples and documentation doesn't show this pattern either.