I have a problem serializing a collection of POCO objects from EF through WCF with IsReference=true. The objects have a couple different nav properties that are completely populated on the server side. But on the client side, for some of the nav properties, only one copy of the nav property is serialized. For example:
Returning List, and each Car has an Owner nav property and a Maker nav property. Suppose I query the list of cars belonging to "Joe" (who only buys Ford) and 5 cars are returned. The first car will have the User nav property pointing at Joe, but cars 2 through 5 have a null User nav property. But the Maker nav property for all 5 cars is pointing at Ford. All cars have the proper foreign key id, and on the server side, all cars have all nav properties filled
By setting IsReference=true, I think the serializer is seeing that Joe is already in the object map, so it doesn't include it for cars 2 - 5. But it doesn't do this for all nav properties (eg, car Maker).
Alguien sabe lo que está pasando?
preguntado el 08 de noviembre de 11 a las 19:11