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
2010-03-24 22:36:21
Thanks for the solution.
Arun
2010-03-29 23:13:49
No Problem! Be really great if you could mark it as correct :) Thanks.
SteadyEddi
2010-03-30 10:52:42