Is Task.Result the same as .GetAwaiter.GetResult()?

The Solution to Is Task.Result the same as .GetAwaiter.GetResult()? is


Pretty much. One small difference though: if the Task fails, GetResult() will just throw the exception caused directly, while Task.Result will throw an AggregateException. However, what's the point of using either of those when it's async? The 100x better option is to use await.

Also, you're not meant to use GetResult(). It's meant to be for compiler use only, not for you. But if you don't want the annoying AggregateException, use it.

~ Answered on 2013-06-24 20:34:19


Most Viewed Questions: