C# 6.0 await in catch/finally

2
Comments
C# 6.0 await in catch/finally

C# 6.0 become more asynchronous-friendly than before. Finally, you can use await keyword in catch and finally blocks! Here is example: class Program { static void Main(string[] args) { do { Console.WriteLine("Before caller " + Thread.CurrentThread.ManagedThreadId); CallerMethod(); Console.WriteLine("After caller " + Thread.CurrentThread.ManagedThreadId); } while (Console.ReadKey().Key != ConsoleKey.Q); } public static async void CallerMethod() { try { throw new Exception(); }...

Read further...