In general, you should avoid doing things like that. ((INHibernatePRoxy)obj).GetImplementation()
On Fri, Oct 10, 2008 at 10:58 PM, Jan Limpens <[EMAIL PROTECTED]> wrote: > > Is there an easy and reliable way to recognize whether I am dealing > with a proxied type or a 'real' entity? > I would like to do things based on an entities type.Name (providing a > view) and I would like to avoid code like > > var typeName = ""; > if (entity is Type1) > typeName = "Type1" > /// ... 100 times > doThing(typeName); > > and instead do > doThing(entity.GetImplementationType().Name) // or something of that sort > > -- > Jan > ___________________ > [EMAIL PROTECTED] > www.limpens.com > +55 (11) 3082-1087 > +55 (11) 3097-8339 > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
