private async static void MyAsyncExample() { AsyncUtility myUtility = new AsyncUtility(); string myWord = await myUtility.BottlesOfBeerSongAsync(); Console.WriteLine(myWord); int myResult = await myUtility.AccessTheWebAsync(); Console.WriteLine(myResult); }
private async static void MyAsyncExample() { //bottles of beer song /* * AsyncUtility myUtility = new AsyncUtility(); * string myWord = await myUtility.BottlesOfBeerSongAsync(); * Console.WriteLine(myWord); */ // API call within AsyncUtility // https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/async/ // AsyncUtility myAPI = new AsyncUtility(); int myNum = await myAPI.AccessTheWebAsync(); Console.WriteLine(myNum); }