Async and Await Query

Occasional Visitor

Why the output is like this
as per my understanding, it should print XYZ first, as I am not writing await in line no. 50



1 Reply

The method Test is not async, which means it will block the current thread while waiting. And since that method is invokes before any await, that is the same thread as the one that executes PrintData, which means Test is effectively blocking PrintData.