I want to keep an entity, being configured by the user on several pages, in Session. This entity is loaded with NHibernate, with some of its properties/collections lazy-loaded. Say:
- Session["order"] = new Order(productRepository.Get(id))
- on some next page, get Session["order"] and now work with it
but, at this time order is OK but its Product (and nested stuff) is broken since they're lazy-loaded in different session.
Is it possible to tell NHibernate that I want to eager-load my transient order's properties to the deepest level? Or, the only solution will be to eager-load at the time of productRepository.Get(id) ? Like, Session.LoadNestedProperties(order, Eager);
Update: http://www.ribbing.net/index.php?option=com%5Fcontent&task=view&id=35&Itemid=1 seems to solve the issue. However I'm not sure that reflection is great...