Best approach here is probably to map your entities into DTOs for serialization.
WCF (i.e. the DataContractSerializer) is able to neatly handle serializing proxies ... I haven't attempted using the XmlSerializer against a proxy. What error are you getting? Cheers, John On Mar 17, 2:40 pm, "F.B. ten Kate" <[email protected]> wrote: > Hello nhusers, > > I've been working with NHibernate a few months now and am starting to > get the hang of things. Currently i'm running into a snag though. I'm > returning object graphs from webservices, so far so good right? > > I've gotten around the circulair reference problem by using > ShouldSerialize{FOO} patterns in different classes (not ideal but i'm > not allowed to use anything above .NET 2.0 so WCF isn't allowed >.<) > > Current problem i'm attempting to tackle is Proxy Classes, since the > graphs are rather large i want most of my properties to be lazy loaded > (simply because users can enable/disable properties when calling the > webservices). I'm not allowed to use lazy loading on properties though > (i am allowed on collections) because webservices don't expect they > need to serialize Proxy objects. > > Even if i Initialize the properties using > NHibernate.NHibernateUtil.Initialize() they are still thought of as > Proxy object. > > Is the any best practise to handle this problem? > > Greetings, > > Folkert -- 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.
