Overloading methods that return a Task<T>

Viewed 71

Maybe I'm overthinking, but what is the proper way of overloading methods that are async and return a Task of T?

Say I have a method with signature async Task<int> Method1(string input, string secondInput) and I want to overload it with async Task<int> Method2(string input, string secondInput, string thirdInput), should the second method body just look like this?

return await Method1(input, secondInput+thirdInput);

My question is, can I just await it like this and not raise any unexpected behaviour for a consumer? Would this be the same as the consumer calling the Method1 and concatinating strings themself?

0 Answers
Related