Inheritance and setting "type discriminator" values

Jun 9, 2010 at 6:28 PM
Edited Jun 9, 2010 at 7:57 PM

In regards to inheritance, this would be useful:  When configuring a table, the ability to specify default values for inherited columns (of the parent table).  Here's the scenario:

I'm making heavy use of the inheritance feature (in one case, four levels deep). All of my typed tables use a type discriminator attribute - which needs to be set whenever a new item is created.  The problem is, only the child table knows it's parent type discriminator (because it is the type) - but it can't be set from the child table in the nHydrate designer.

In the meantime, I've been analyzing the best way to handle this.  I don't see a good place to put this kind of code in the extension classes. An "OnNewItem" event might be useful...

What do you think?