Page 1 of 1

Mixing Table Per Type and Table Per Hierarchy Inheritance

Posted: Wed 04 May 2011 16:17
by ruionwriting
How to perform something similar to http://www.insidercoding.com/post/2010/ ... tance.aspx?

Here my scenario:

- I have a provider model were I have a base class Provider (contains all common properties). Maps to one table on the Db;

- Then I have 4 providers: Domains, Payments, Dns and Certificates. Earch maps to one table with the particular properties for each context;

I've tried several ways, also reading the supplied article, and I can't get the model to validate properly.

Is it possible to do this?

Posted: Thu 05 May 2011 13:24
by StanislavK
I'll send you a sample project in a letter, please check that it was not blocked by your mail filter.

The mentioned walkthrough apparently misses the last point: since the base type is abstract, and the derived types have no key fields, it is necessary to set mapping for the ProductId column of the Product table in each of the derived entity classes.

Please tell us if this helps.

Posted: Thu 05 May 2011 13:40
by ruionwriting
Hi have the email. I'm going to do some tests.