The line next to await calls wait until we get the result from generatePartLifeNotifications_ORN method.
Well, what did you expect? await
will execute that method asynchronously and will release the current thread for doing work somewhere else. When that asynchronous task is completed, the thread will comeback to pick the function execution from there with the result (unless you specify .ConfigureAwait(false)
, then any thread could pick the execution).
"Await" means something like "wait for", so the execution is waiting for that method to complete, but the thread left to work in something else and it is not waiting.
If you executed this in a synchronous fashion, the execution order will be the same, but the calling thread will be blocked waiting for GeneratePartLifeNotifications_ORN
to finish. The magic of async, is to allow threads to working in something else instead of waiting for things that are happening away (like a webservice, or a database).
Cheers.