I am newbie to asynchronous programming in C#. In general I understand concepts of asynchronous programming but I am not completely down with all the details so I got this question.
What is the conceptual difference between these two methods?
public async Task<int> Action1()
{
// ...
}
public Task<int> Action2()
{
// ...
}
How should I think about each of these when I see them in code? Eg. what mental model should come to my mind? And in what use-cases should I use one over the other (if there are any preferences)?
Edit: Does this code make sense:
public async Task Action1()
{
await someAsyncMethod(); // do nothing with result
}
public Task Action2()
{
return Action1()
}