Hi I have a small question with async/await on webapi. Is there a difference between these two usages and which one is considered the correct one? After reading SimilarQuestion on SO I guess Variant 1 is better because of less overhead but I need to be sure, therefore I ask again;)
Variant 1:
public Task<string> Get(){
return Bar();
}
variant 2:
public async Task<string> Get(){
return await Bar();
}
Methods:
public async Task<string> Foo(){
await Task.Delay(5000);
return "Done";
}
public Task Bar(){
return Foo();
}
Thanks for hints