views:

161

answers:

1

In a special case we do not want to change mapping files and adding lazy="false" to each of them because of upgrading NHibernate. Is it possible to disable lazy loading in a total application by just adding something to app.config or web.config?

+2  A: 

From what I can tell you will have to change the mapping files. I might be wrong but I couldn't find any global setting.

If you didn't want to change the class definition you could define it in the root element of each mapping file you have:

<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0" default-lazy="false">
JoshBerke
Thanks Josh, there is also a related link: https://www.hibernate.org/407.html
afsharm