|
I'm a little bit confused by your question. You already did cast your object as your real type. The proxy type inherits your class's type and then throughout the application you reference it with your type. It's not actually possible to reference it as the proxy since that proxy type is generated at run-time.
If you mean that you want to obtain the inner type within the proxy, one that does not add the proxy behaviors (possibly for type checking with Inheritance), then the only way I know to do is to do the same thing the NHibernate's SessionImpl.UnProxy method does it. All classes it uses are public, so you could put that same implementation in your code, but I would probably advice against it.
Ideally, come up with a way to work around whatever it is you need this for. Maybe you just shouldn't set this object to lazy if it matters that much?
|