I have an abstract base class 'Shape' that has a subclass 'Circle',
'Square'. All are mapped to the same table using
DiscriminateSubclssesOnColumn.
I want to retrieve a Shape from the datastore and then check the type
of the shape but nhibernate always maps to the base class 'Shape' e.g.
Shape s = session.Get<Shape>(1);
if (s is Circle){
//Do Whatever...
}
else if (s is Square)
{
//Do Something
}
//None are detected
and
s.GetType() always returns Shape - which is an abstract class
Is there a way to get the underlying class type?
--
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.