By using Task.Run
or Task.Factory.StartNew
we can convert synchronous actions to tasks, so that we can use await
, like this:
await Task.Run(() => { SomeMethod(); }
In the meantime, many methods themselves have asynchronous implements, so it is recommended to directly use
await SomeMethodAsync();
But what's the difference between the two?