Re:Asynchronous Programming in C#
by jtbarrett on Friday September 24, 2021 @11:43AM
(#28643946)
If this really needs to happen then I like .GetAwaiter().GetResult() instead of .Result to get the same exception behavior as await rather than the wrapped AggregateException that .Result throws. This is especially helpful if DoSomethingAsync sometimes throws synchronously rather than returning a task.
[ Parent
| on HN ]
There are no comments on this comment yet.