For example, in the code below, the last method M2Async is synchronous and does not have async/await as otherwise there would need to be a call to M3Async after await and the call graph would continue?
For clarity (from C# in a Nutshell):
- A synchronous operation does its work before returning to the caller.
An asynchronous operation does (most or all of) its work after returning to the caller.
public void Main() { Task task = M1Async(); // some work int i = task.result; // use i etc }
private async Task M1Async() { int i = await M2Async(); // some work return i; }
private Task M2Async() { return Task.FromResult(2); }