Prevent mapping all public members of a class in Fluent NHibernate?

Fluent Nbernate is not trying to persist all your public members. It's the Nbernate proxying mechanism that requires all members to be virtual; they may or may not be used for persistence, but they're needed anyway You either need to disable lazy-loading and proxying for the entity, or (preferably! ) expose a DTO in your WS rather than the entity directly.

Fluent Nbernate is not trying to persist all your public members. It's the Nbernate proxying mechanism that requires all members to be virtual; they may or may not be used for persistence, but they're needed anyway. You either need to disable lazy-loading and proxying for the entity, or (preferably!) expose a DTO in your WS rather than the entity directly.

I'm not the author of the WS, so I can't change anything from that end. Looks like I'll have to disable lazy-loading. Thanks.

– alimbada Apr 30 '10 at 9:27 Is it correct to disable lazy-loading just for that entity by calling Not.LazyLoad() in the constructor of the ClassMap? Or is there a better way to do this? There seems to be a few ways to do it here: stackoverflow.Com/questions/1412002/… – alimbada Apr 30 '10 at 9:39 1 Not.LazyLoad() in the ClassMap is the easiest way to go if it's only particular entities that need it doing; if it's everything, you should look into a convention (one of the answers in that question you linked to uses the DefaultLazy convention).

– James Gregory Apr 30 '10 at 16:42.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions