Search code examples
wcflinq-to-sql.net-3.5

LINQ 2 SQL with WCF and serializing EntityRef


I have a LINQ 2 SQL project and I'm trying to use it in WCF.

EntitySets serialize perfectly if I specify them with the LoadWith<Type> dataloadoptions. The problem is EntityRefs.

I have a customer with 1 address. But 1 address can have multiple customers.

How do I make sure that the Customer is passed over the line WITH the Address?

There is no [DataContract] attribute on the Address property of Customer. How do I solve this?

SerializationMode is already Unidirectional.


Solution

  • The solution was to disable the child <> parent relation.