WP7 Client's DataContractSerializer and Circular references

Dec 9, 2010 at 4:48 AM

Hey Guys,

I have been developing with the OData client for Windows Phone 7 and have just tried to use the DataServiceState.Save() function to try to keep my Context during tombstoning. My WebService is providing a fairly large and complex collection of business object which contains circular references (eg Invoice has collection of invoice lines and invoiceline has reference to its invoice).

When I called DataServiceState.Save() during an application deactivation (clicking the Start/Home button) I noticed that the process was taking a long time. Broke out the debugger and connected to have a look, and the out stream was up to 100meg (I had maybe 5 invoices loaded). Upon further investigation it seems that the DataContractSerializer in WP7 cannot handle circular references.

Does anyone have any suggestions on how to go about resolving this issue as I don't really want to have to download my data each time the App wakes up.

Feb 14, 2011 at 11:19 PM

Hey all, thought I would update my own post.

Seems the issue stems from my use of the expand keyword in my queries. According to the discussion (http://social.msdn.microsoft.com/Forums/en/adodotnetdataservices/thread/0806c41a-2699-4390-8aaf-14b9c75a9dca) the tombstoning support of DataServiceState does not extend to the use of the expand keyword.

Is there any word on when the next version will be released?



Mar 1, 2011 at 5:34 AM

Hi Ben,

Unfortunately I can't share the specifics of timelines just yet but we are working on improving our tombstoning support. Keep an eye on the team blog as we will have a blog post when we have design details to share.