示例#1
0
 public static async Task PrepareSandwichAsync()
 {
     await Task.Run(() =>
     {
         BaseCoffeeShop.PrepareSandwich();
     });
 }
示例#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();
     });
 }