Exemplo n.º 1
0
 public static async Task PrepareSandwichAsync()
 {
     await Task.Run(() =>
     {
         BaseCoffeeShop.PrepareSandwich();
     });
 }
Exemplo n.º 2
0
 /* I must use the async and await keyword */
 public static async Task PrepareCoffeeAsync()
 {
     /* Create a new thread or consume the asynchronous method */
     await Task.Run(() =>
     {
         BaseCoffeeShop.PrepareCoffee();
     });
 }