Hi Niclas, I think that you're trying to solve the issue from the wrong perspective. You want to stop NH to load a collection because you don't want to expose that collection through the WCF service. In my opinion you should change the object returned by the WCF to a new object which does not contain the collection at all (using some sort of DTO).
I agree with you: Who am I to suggest it? You're right.. :) This is the reason why I'm going to point you to these addresses: http://ayende.com/Blog/archive/2009/05/14/the-stripper-pattern.aspx and http://ayende.com/Blog/archive/2010/08/04/nhibernate-is-lazy-just-live-with-it.aspx <http://ayende.com/Blog/archive/2009/05/14/the-stripper-pattern.aspx>To Ayende: for finding out those posts i googled for "ayende strip club".. Pls, do not have bad thoughts when you'll watch your blog statistics about google search keys! :) On Tue, Oct 26, 2010 at 10:18, Niclas Pehrsson <[email protected]> wrote: > Im looking for a method to use QueryOver and tell it to not load an > associated list on my entity. > > The options are > Default > Eager > Lazy > > I want the result from lazy but I'm working with wcf services and when > serializing it will load the associated list anyway. Are there some > way there I can tell it to never load the list. Like just skip loading > it? > > I know I can do it by change my mapping and have different entitynames > but I'm looking for a more simple approach. > > -- > You received this message because you are subscribed to the Google Groups > "nhusers" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<nhusers%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > > -- Alessandro Ghidini -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
