How can I disable lazy NHibernate loading for a shared application?

In the special case, we do not want to change the mapping files and add lazy = "false" to each of them due to the NHibernate update. Is it possible to disable lazy loading in a general application by simply adding something to app.config or web.config?

+3
source share
1 answer

From what I can tell you will have to change the mapping files. Maybe I was wrong, but I could not find the global settings.

If you do not want to change the class definition, you can define it in the root element of each mapping file that you have:

<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0" default-lazy="false">
+2
source

Source: https://habr.com/ru/post/1733013/


All Articles