Bidirectional Serialization with Linq
Posted
by Andy
on Stack Overflow
See other posts from Stack Overflow
or by Andy
Published on 2010-03-18T08:56:27Z
Indexed on
2010/03/28
16:43 UTC
Read the original article
Hit count: 744
Anyone know why only undirectional serialization is supported in the Linq designer?
Consider the following example:
Say we have a Customer
who requested an Order
containing Products
. We set the Serialization Mode in the Linq designer to Unidirectional to enable serialization.
When looking at the code for the Order
object, the DataMember
attribute is added to all its internal properties such as ID
,OrderNumber
, etc. and also to the EntitySet
of Products
, but not to Customer
.
One can get around this by manually adding the DataMember
attribute to Customer
, but this becomes quite cumbersome when there's loads of entities in the database.
© Stack Overflow or respective owner