Let's say I got an async
method in C# .Net Core:
public Task<ResultClass> Action() { ... }
What is the difference between invoking: ResultClass res = await Action();
and invoking: ResultClass res = Action().ConfigureAwait(false).GetAwaiter().GetResult();
The await keyword will free the current thread during the work. So if you have a limited number of thread it's really useful.
The "GetAwaiter().GetResult()" will do the same but synchronously so the current thread will be blocked during the work.
The "ConfigureAwait(false)" is a configuration that have no sense if you are in synchronous code but can be usefull with the await
That you ensure the following will be called directly and avoid potential dead locks.