I'm using NHibernate 3.0.0 and the new feature lazy properties. However, in some queries I want to eagerly load the properties and I would like the query to result in non-proxied entity instances. I also prefer to use the LINQ provider or QueryOver. So my two questions related to this are:
Cheers
For question 1: The answer is no, 'fetch all properties' as described in http://ayende.com/blog/4377/nhibernate-new-feature-lazy-properties is currently only supported in HQL.
I do remember seeing in the NH Google Discussions somewhere, I'm unable to find the thread. Will update answer if I can find it today. But as of the current 3.1 release it's only in HQL.
For question 2: I don't know if there is a way to avoid this, I usually transform them to DTO's and serialize the DTO, not the NH Poco, when using WCF. Leonardo's link looks interesting and may be able to help.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With