SharpArch.Domain.DomainModel.BaseObject.GetTypeUnproxied C# (CSharp) Method

GetTypeUnproxied() protected method

Returns the unproxied type of the current object.

When NHibernate proxies objects, it masks the type of the actual entity object. This wrapper burrows into the proxied object to get its actual type.

Although this assumes NHibernate is being used, it doesn't require any NHibernate related dependencies and has no bad side effects if NHibernate isn't being used.

Related discussion is at http://groups.google.com/group/sharp-architecture/browse_thread/thread/ddd05f9baede023a ...thanks Jay Oliver!

protected GetTypeUnproxied ( ) : Type
return System.Type
        protected virtual Type GetTypeUnproxied()
        {
            return this.GetType();
        }