Developers often write:
var result = GetDataAsync().Result;
or
var result = GetDataAsync().GetAwaiter().GetResult();
This is how 80% of production deadlocks happen.
👉 Why It Deadlocks
Async code tries to resume on the captured context (SynchronizationContext).
But since you blocked the thread with .Result, it can’t resume → deadlock.
✔ The Fix
Make the entire call chain async:
var result = await GetDataAsync();
✔ Hidden Life-Saving Trick
If refactoring all async is impossible (legacy):
ConfigureAwait(false)
Use it in library code so it doesn’t require a synchronization context.
