I have an async call and I wrapped it inside a Task.Run to run it in another thread. Will the organizations assignment and all subsequent code halt until it returns and get the Result? Or will it continue and sometimes generate a null reference exception once it reaches the foreach? In my tests it never throws errors, but maybe I was just lucky.
IDictionary<string, organization> organizations = Task.Run(() => this.GetOrganizationsAsync()).Result;
...lines of code
foreach (var organization in organizations)
{