This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading.Tasks; | |
namespace TaskExample | |
{ | |
public class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
// Create and start tasks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Threading.Tasks; | |
namespace AsyncExample | |
{ | |
public class Program | |
{ | |
public static async Task Main(string[] args) | |
{ | |
// Call an async method and wait for it to complete | |
int result = await AsyncMethod(); |