Brief explanation of Async/Await in .Net 4.5

.net-4.5, async-await, c#

Solution

`await` pauses the method until the operation completes. So the second `await` would get executed after the first `await` returns.

For more information, see my `async` / `await` intro or the official FAQ.

Problem

How does Asynchronous tasks (Async/Await) work in .Net 4.5? Some sample code: ``` private async Task<bool> TestFunction() { var x = await DoesSomethingExists(); var y = await DoesSomethingElseExists(); return y; } ``` Does the second `await` statement get executed right away or after the first `await` returns?

Original source