How to chain independent C# tasks?
问题 Let's say I have two independent async functions (that I don't control) that create Task objects: Task A(); Task B(); and some other non-async function void X(); How do I construct a single Task chain that executes all of these in sequence and allows further continuations (that will execute after X) to be appended? If I do this: Task Sequential() { return A() .ContinueWith(t => { B(); }) .ContinueWith(t => { X(); }); } that does not work, because B will start a new Task chain. If B takes a