Right, if I create the same concept with these classes as, instead, interfaces, and say
Code:
IPet pet = new Dog();
if (pet is IDog)
returns true for both IDog and ICat, because NHibernate creates a weird proxy superclass that is the culmination of Pets, Dogs, and Cats properties, all combined.
I suppose this is my real question and issue. If I had another joined subclass, say lizards, the object would contain all the properties of DOG, CAT, PET, and LIZARD!
The only real way to tell what is the real type of the object is to look at the properties exclusive to a cat, or dog, and see if accessing them doesn't throw an exception. For example, if I say
Code:
try { dog.Bark; } catch { //object is not a dog }
but this is hacky and not cool.