Hi Dick,
The code in the Infoworld article is actually a bit different... in that case Task.Run() is being awaited, which is why the method is also marked as "async". The code I'm proposing does not await the Task.Run call, which is the whole point as the idea is to short-circuit the need to keep propagating the async calls up through the method hierarchy.
It is definitely confusing though! I still haven't reached a definitive answer.
Nick
Task-based async best practice
Task-based async best practice
Hello Nick,
I have planned to make methods of one of our X# programs async as well. No doubt it requires a couple of searches. I'll keep your issue in mind and should I come around something which may help you I'll add it here.
Dick
I have planned to make methods of one of our X# programs async as well. No doubt it requires a couple of searches. I'll keep your issue in mind and should I come around something which may help you I'll add it here.
Dick