What is the difference in using asyn/await vs await task.run()
await task.run example -
public static void Main()
{
await Task.Run(() =>
{
return "Good Job";
});
method1();
method2();
}
Async await example-
public static async void Launch()
{
await GetMessage();
Method1();
Method2();
}
public static async Task<string> GetMessage()
{
//Do some stuff
}