C # dynamic proxy
1 answer
The answer is here in the previous question.
You can tell if a class is NHibernate Proxy by dropping it (unsurprisingly) INHibernateProxy.
If you need to get a "real" object, use:
Session.GetSessionImplementation (). PersistenceContext.Unproxy (proxiedObject) You don't need to check proxies to call Unproxy; it returns the original if it is not a proxy.
+3
a source to share