EntityFramework WCF issue

Posted by Andres Blanco on Stack Overflow See other posts from Stack Overflow or by Andres Blanco
Published on 2009-10-25T02:33:15Z Indexed on 2010/04/06 22:03 UTC
Read the original article Hit count: 257

Filed under:
|

Right now i'm doing some tests involving entityFramework and WCF. As I understand, the EntityObjects generated are DataContracts and so, they can be serialized to the client.

In my example I have a "Country" entity wich has 1 "Currency" as a property, when I get a Country and try to send it to the client, it throws an exception saying the data cant be written.

But, the thing is, if I Get a Currency (which has a collection of Countries) and dont load its countries, it does work. The client gets all the entities.

So, as a summary: - I have an entity with another entity as a property and cant be serialized. - I have another entity with an empty list of properties and it is successfully serialized.

Any ideas on how to make it work?

© Stack Overflow or respective owner

Related posts about entity-framework

Related posts about wcf