You should use the async
and await
keywords all the way up, or you shouldn’t use async at all.
Your second option is not really asynchronous. It’s calling an asynchronous operation and blocking on it synchronously with task.GetAwaiter().GetResult()
.
On top of being very complicated it’s not asynchronous and may lead to deadlocks.