开发者

LINQ 2 SQL with WCF and serializing EntityRef

开发者 https://www.devze.com 2023-01-06 19:04 出处:网络
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 LoadWi开发者_Python百科th<Type> dataloadoptions. The problem is EntityRefs

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 LoadWi开发者_Python百科th<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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消