In .Net there are several ways to perform type checking:
- the 'is' keyword
- Type.IsAssignableFrom()
- Type.IsInstanceOfType()
What confuses me is the proxying in NH which affects things such as myEntity.GetType() (which returns you a proxy type instead of the actual entity type), and depending the lazy loading and proxying configuration, one will see different behaviors in different scenarios. We use the 'is' keyword a lot and it has been working fine with NH 3.0/3.1, but starts to fail in some cases with NH3.2/3.3. It is really frustrating and make upgrades very difficult.
Is there any good documentation around polymorphic behaviors and type checking for NH (especially 3.3)? Or how do people usually do it?
Regards,
Joseph