-
Book Overview & Buying
-
Table Of Contents
Tools and Skills for .NET 10 - Second Edition
By :
C# 5 introduced two C# keywords when working with the Task type. They are especially useful for the following:
Later in this chapter, you will see how the async and await keywords can implement multitasking for a GUI by building a WPF app that fetches data from the Northwind database asynchronously.
But for now, let’s learn the theory of why these two C# keywords were introduced, and then later, you will see them used in practice.
One of the limitations with console apps is that you can only use the await keyword inside methods that are marked as async, but C# 7 and earlier do not allow the Main method to be marked as async! A feature introduced in C# 7.1 provides support for async in Main. Let’s explore that feature: