Found the problem:

DefaultProxyFactory
https://github.com/nhibernate/nhibernate-core/blob/378be39482e36a419e3e96fea54de211ef9580ce/src/NHibernate/Proxy/DefaultProxyFactory.cs

Has two ways of creating and executing the code on the proxy:

The first used by non-lazy stuff uses the "DefaultLazyInitializer" which 
does up-wrap the TIE execption:

Here is where it does the un-wrapping.
https://github.com/nhibernate/nhibernate-core/blob/378be39482e36a419e3e96fea54de211ef9580ce/src/NHibernate/Proxy/DefaultLazyInitializer.cs#L36

Here is where it is called.
https://github.com/nhibernate/nhibernate-core/blob/378be39482e36a419e3e96fea54de211ef9580ce/src/NHibernate/Proxy/DefaultProxyFactory.cs#L17

The second way used by the lazy stuff uses 
"DefaultDynamicLazyFieldInterceptor"
https://github.com/nhibernate/nhibernate-core/blob/378be39482e36a419e3e96fea54de211ef9580ce/src/NHibernate/Proxy/DefaultProxyFactory.cs#L34

And this class is missing the unrap stuff here:
https://github.com/nhibernate/nhibernate-core/blob/378be39482e36a419e3e96fea54de211ef9580ce/src/NHibernate/Intercept/DefaultDynamicLazyFieldInterceptor.cs


Pretty sure this is a bug now,hopefully this is enough info for someone to 
create a fix.

Thanks, Mark

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to