Accepted Answer

You are creating a deadlock situation the way you use async/await in combination with Task<T>.Result.

The offending line is:

return this.GetMyObjectsAsync(ids).Result.ToList();

GetMyObjectsAsync(ids).Result blocks the current sync context. But GetMyObjectsAsync uses await which schedules a continuation point for the current sync context. I'm sure you can see the problem with that approach: the continuation can never be executed because the current sync contextis blocked by Task.Result.

One solution that can work in some cases would be to use ConfigureAwait(false) which means that the continuation can be run on any sync context.

But in general I think it's best to avoid Task.Result with async/await.

Please note that whether this deadlock situation actually occurs depends on the synchronization context that is used when calling the asynchronous method. For ASP.net, Windows Forms and WPF this will result in a deadlock, but as far as I know it won't for a console application. (Thanks to Marc Gravell for his comment)