This recipe shows how to design a very basic type that is compatible with the await
operator and dynamic C# type.
To step through this recipe, you will need Visual Studio 2012. You will need Internet access to download the NuGet package. There are no other prerequisites. The source code for this recipe can be found at BookSamples\Chapter5\Recipe9
.
To learn how to use the dynamic
type with await
, perform the following steps:
Start Visual Studio 2012. Create a new C# Console Application project.
Add references to the ImpromptuInterface NuGet package by following these steps:
Right-click on the References folder in the project and select the Manage NuGet Packages… menu option.
Now add your preferred references to the ImpromptuInterface NuGet package. You can use the search function in the Manage NuGet Packages dialog as follows:
In the
Program.cs
file, use the followingusing
directives:using System; using System.Dynamic; using System.Runtime...