async and await are two very popular keywords among .NET Core developers writing asynchronous code with the new asynchronous APIs provided by .NET Framework. They are used for marking code when calling asynchronous operations. In the last chapter, we discussed the challenges of converting a synchronous method into an asynchronous one. Previously, we did this by breaking down the method into two methods, BeginMethodName and EndMethodName, which can be called asynchronously. This approach makes the code clumsy and difficult to write, debug, and maintain. With the async and await keywords, however, the code can stay how it was in the synchronous implementation, with only small changes required. All the difficult work of breaking down the method, executing the asynchronous method, and getting the response back to the program is done by the compiler.
All...