using System.Threading.Tasks;
public async static Task Main()
Console.WriteLine("Main Thread start -> Thread #: {0}\n", Thread.CurrentThread.ManagedThreadId);
Task t1 = PrintThreadAsync();
Console.WriteLine("\nHey there from Main() -> Thread #: {0}", Thread.CurrentThread.ManagedThreadId);
public static async Task PrintThreadAsync()
Console.WriteLine("Thread of task beginning (still the Main Thread!) -> Thread #: {0}", Thread.CurrentThread.ManagedThreadId);
await Task.Run(() => AwaitedMethod());
Console.WriteLine("\n Thread of task ending (May be new thread or the same as from awaited method) -> Thread #: {0}", Thread.CurrentThread.ManagedThreadId);
public static void AwaitedMethod()
Console.WriteLine("\n Thread of awaited method (Here always new thread!) -> Thread #: {0}", Thread.CurrentThread.ManagedThreadId);