Mark Main method as Async Entry Point - CSharp Thread Asynchronous

CSharp examples for Thread Asynchronous:Async

Description

Mark Main method as Async Entry Point

Demo Code

using System;//  ww  w .j av  a  2  s. c  o m
using System.ComponentModel;
using System.Threading.Tasks;
class AsyncEntryPoint
{
   static async Task Main()
   {
      Console.WriteLine("Before delay");
      await Task.Delay(1000);
      Console.WriteLine("After delay");
   }
}

Related Tutorials