I'm using ADO.NET dataservices in a Silverlight application and since the silverlight libraries don't support the ToList() call on the IQueryable I thought it might be possible to create an extension method around this called SilverlightToList(). So in this method I'm calling the BeginExecute method on my context as shown below:
var result = context.BeginExecute<T>(currentRequestUri,null,context);
result.AsyncWaitHandle.WaitOne();
return context.EndExecute<T>(result).ToList();
The problem is that when I call the WaitOne() method this results in a deadlock. Is this a limitation of ADO.NET dataservices in Silverlight? Is there perhaps a workaround for this?
Thanks in advance!