When I call
Session.Load(objectType, id);
for one of my entity types (which is configured to be lazy) it appears that NHibernate is returning a Proxy to the instance - i.e. the entity type is:
Domain.Account
but the returned instance type is
CProxyTypeAccountDomain_INHibernateProxy_ISerializable2
I understand the the principal of using proxies to lazy load objects that are associated with a root object, but I'm unclear as to why a proxy would be returned when I am directly loading the object.
I think I can work around this issue OK, but I was hoping someone could clarify what is going on here - is there any benefit in using a proxy here and is this the expected behaviour?
|