Let's say I'm already in an async method, and am going to await the results of a nested method:
var x = await CallMethodAsync();
Then, let’s say you could choose to write CallMethodAsync in either of two ways:
public Task<int> CallMethodAsync() {
var y = DoStuff();
return _dependency.CallAnotherMethodAsync(y);
}
or:
public async Task<int> CallMethodAsync() {
var y = DoStuff();
return await _dependency.CallAnotherMethodAsync(y);
}
Is there a difference? Is there any point to adding the async / await syntax in the CallMethodAsync method definition?