Let's say I have a function return Task<bool>
, basically I can implement it in 2 ways, what is the difference, pros/cons?
public async Task<bool> FooAsync()
{
return await Task.Run(() =>
{
Thread.Sleep(100);
return true;
});
}
public Task<bool> FooAsync()
{
return Task.Run(() =>
{
Thread.Sleep(100);
return true;
});
}