I love NHibernate's ability to have one table to store multiple types based on a discriminator. When I fetch an RegularItem, it will come back as the sub type of the discriminator is correct.
Does SubSonic have this ability?
subsonic
I love NHibernate's ability to have one table to store multiple types based on a discriminator. When I fetch an RegularItem, it will come back as the sub type of the discriminator is correct.
Does SubSonic have this ability?
Best Answer
Do you mean, you have a table with different values stored in it and, dependend on a value you want to return different objects?
e.g. you have a table pet
and you want to get dog and cat objects from it?
I have a similar case, and I solved it by creating a Dog class and a Cat class that both inherit from subsonic's autogenerated pet class and implement my IPet interface stub, in conjunction with a factory method, where I cast my objects to the new Type:
Typed from memory, not guaranteed to compile. But the theory should be clear.