Cover

ADO.NET Data Services Bug...

May 22, 2008
No Comments.

Silverlight Logo
There is a bug in the current ADO.NET Data Services that ships with .NET 3.5 SP1 Beta 1.  The problem involves saving related data.  If the child object requires the relationship to the parent object, the update fails.

For example, if you have a Customer with a list of Orders.  The relationship between the Customers and Orders is 1…* (0 or 1…* doesn’t cause this bug).  If you create a Customer and an Order to be updated with the ADO.NET Data Services client library at the same time, the current code attempts to save both the Customer and Order and then update the link between them separately.  Of course if the relationship really is 1…*, then you can’t save an Order that doesn’t have a customer so the update fails.  Unfortunately this can update the Customer and just ignore the error with the Order not saving.

The only way to make this work is to relax the relationship so you can create the unrelated child object.

This is a bug in the server code and will be fixed in future builds of ADO.NET Data Services.

HTH