With C# tasks, Wait() necessary before checking .Result?

Viewed 2647

Written inside a non-async method, is there any difference between this code...

return MyMethodAsync().Result;

...and this, below?

var task = MyMethodAsync();

task.Wait();

return task.Result;

That is to say, is the behavior of those two the identical?

Is it correct to say that the second snippet does not block the executing thread (the non-async method calling MyMethodAsync()), while the first does?

2 Answers
Related