tags:

views:

45

answers:

1

I careated couple of linq classes & marked the datacontext as unidirectional. Out of four classes; one is main class while other three are having the one to many relationship with first one; When I load the object of main class & put into the memory OR serialize it into an XML file; I never get the child class data while it is maked as DataContractAttribute. How can I force object to put the child class data into XML file or into cache ?

A: 

Make sure the 3 additional entities are being loaded with the first.

Use DataLoadOptions to make sure the additional entities are retrieved with the main class.

Alternatively write a custom projection class (like a ViewModel), and specifically select all the data required. Then serialize that class instead.

SteadyEddi
Thanks for the solution.
Arun
No Problem! Be really great if you could mark it as correct :) Thanks.
SteadyEddi