For .NET 4.0, I used the idea of this blog article for the chain of tasks that you describe. In particular, see the Next section. Not that its version expected you to pass a function returning a task, instead of just passing a method like you to ContinueWith
Aside, Then brings you closer to SelectMany , you will need to link tasks using LINQ from the sentences. I mention this mostly as a syntax option, while async / await is in .NET 4.5, although I don't actually use it myself.
Gideon engelberth
source share