开发者

Storing object into cache using Linq classes and velocity

开发者 https://www.devze.com 2022-12-24 15:27 出处:网络
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 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开发者_如何学Python 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 ?


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.

0

精彩评论

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