views:

39

answers:

2

I want to take a snapshot of an instance of an entity and therefore I want to force all proxies to load for this instance.

I don't want disable lazy loading for the majority of the time I just wondering if there is an API I can call to force all proxies to be loaded.

+1  A: 

Well there is a utility function NHibernateUtil.Initialize(object) which is not recursive if i remember correctly. With the help of NHibernateUtil.IsInitialized(object) you can create a method of your own that loads all proxies in an oject

Jaguar
A: 

There is a lazy initializer for NHibernate on codeproject that should be able to accomplish this.

DanP