开发者

Storing object into cache using Linq classes and velocity

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜