You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In most cases, both work. The difference is when the task is faulted. await will throw the first child exception stored in the AggregateException. The Result property will throw the AggregateException.
I've added this to our backlog, and added the "up for grabs" label if you want to submit a PR that adds the answer I wrote above. Otherwise, we'll update it when we next update this article.
Activity
BillWagner commentedon Apr 29, 2019
Thanks for raising this question @foofoodog
In most cases, both work. The difference is when the task is faulted.
awaitwill throw the first child exception stored in theAggregateException. TheResultproperty will throw theAggregateException.I've added this to our backlog, and added the "up for grabs" label if you want to submit a PR that adds the answer I wrote above. Otherwise, we'll update it when we next update this article.
Add explanation for using await over Result
Add explanation for using await over Result (#14860)