A Primer to await Expressions
Asynchronous methods contain one or more
await expressions. If no
await expressions are present in the method, a compiler warning is generated telling the method will execute synchronously under all circumstances, questioning why the method was declared using the
async modifier to begin with. Figure 31.20 shows this warning.
await expressions provide points in an asynchronous method body where the method can be suspended and resumed. Upon hitting an
await expression, the compiler-generated code first evaluates the operand, which we referred to as the awaited ...