Reputation: 2166
I have a WPF application which tightly coupled to linq2sql through WCF. It now turns out the Customer would like some sort of Offline mode using an xml file structure.
Lets say I have a Customers Table, Each Customer would have many Orders, with each order only belonging to one customer, so In my table design I would have a fk_CustId Column in my Orders table.
I would like to know if there is any straightforward pattern of serializing an instance of Customer(Linq2sql entity), so that it would automatically include the Order Child nodes in the xml.
Any help would be appreciated.
Upvotes: 0
Views: 352
Reputation: 31071
I'm not sure what you mean by "tightly coupled". If you are using Linq2Sql to fill your data contracts in the service, then when they get to the client they are no longer "live" Linq2Sql objects, but plain simple data transfer objects.
In other words, you have total control over what you choose to send from the service to the client in your data contract classes. Just modify your data contract classes to send what you want to send.
Upvotes: 1