Trying to understand the new async/await pattern, I have one question which I can\'t find an answer to, namely if I should decorate my methods with async, if I intend to cal
The async
in the signature is there to allow the compiler to create the state-machine rewriting of the contained code that is necessary to implement the await
semantics in the general case.
Your example is exactly the special case where you do not need that rewriting: The asynchronous operation is the last thing happening within a method. That kind of method is already possible and valid in .NET4.0
. This compatibility might be one reason to avoid async
when you do not need it.