This is a demonstration of how .net (core) async functions are implemented by the compiler and the Framework
There are three Projects:
ThreadingDemo: Demonstration of what happens, if ther is no synchronization context for the Thread in which an async function is called.
AsyncStateMachine: Shows the state machine, that is generated by the compiler for an async function. It is a simplified and more readable version as the real compiler generated code.
SyncContextDemo: Demonstration of what happens, when a synchronization context is added to the main thread in the ThreadingDemo Project