if (entity is INHibernateProxy)
{
  (entity as
INHibernateProxy).HibernateLazyInitializer.Session.Load<T>..... etc
 }

Of course that code is NOT in the entity but in the abstaction layer I
talked about!


On Sep 23, 8:59 pm, José F. Romaniello <[email protected]> wrote:
> 2009/9/23 Harm Neervens <[email protected]>
>
>
>
> > I want this because my entities are POCO, and bu that I mean real
> > Persistance Ignorant.
>
> Ok, that is good.
>
> > I have code in my entities that references ISessionFactory, I create a
> > dependancy to the NHibernate framework, and that's not what I want.
>
> Yes. I understood you.
>
> > When I always have proxies, then in my base class I can use code like:
>
> >            if (entity is INHibernateProxy)
> >            {
> >                (entity as
> > INHibernateProxy).HibernateLazyInitializer.Session.Load<T>..... etc
> >            }
>
> First; I can't see why do you need the session here and what are you trying
> to do.
> Second and most important: Where goes now the *persistence ignorance*? *
> INHibernateProxy* is not something that I will like to see in a persistence
> ignorant base class.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to