Post

Async-Await

To understand await/async try debug the following code.

You will see that await automatically call the GetAwaiter() of class implementing INotifyCompletion. And then CLR automatically calls IsCompleted(), then if it returns true, GetResult() is called, if false, OnCompleted() and GetResult() subsequently are called.

Debugger.Break() I added it on purpose, if you don’t put the breakpoints there, the debugger won’t go there.

This post is licensed under CC BY 4.0 by the author.