I’ve been programming async C# for years, but today was the first time I noticed a method that returns a Task
without using the async
and await
keywords.
What is the difference between these 2 methods?
Task<int> SomeMethod()
{
return SomeAsyncMethod();
}
versus
async Task<int> SomeMethod()
{
return await SomeAsyncMethod();
}
In what situation should/shouldn’t we use the async
and await
keywords?
Is there a performance difference?
There is probably already an answer to this question, but I can not find it.