public static void Main()
Func<int, int, int> funcDelegate = delegate (int num1, int num2)
Console.WriteLine($"Test method begins in thread {Thread.CurrentThread.ManagedThreadId}");
Thread.Sleep(TimeSpan.FromSeconds(3));
IAsyncResult asyncResult = funcDelegate.BeginInvoke(30, 20, null, null);
Console.WriteLine($"Main thread {Thread.CurrentThread.ManagedThreadId} does some work.");
Thread.Sleep(TimeSpan.FromSeconds(2));
int result = funcDelegate.EndInvoke(asyncResult);
Console.WriteLine($"DoWork(30, 20) returned {result}");