The following procedure describes how to create a Table Per Concrete Type hierarchy using the Model Refactoring Wizard. For the purpose of this example we use the TPC_Horse and TPC_Dog tables. Both these tables contain the following identical columns: BirthDate and Genus.
First, we move the TPC_Horse and TPC_Dog tables onto the design surface to create classes with the same respective names:
Then we select these two classes, call their context menu, and select the Model Refactoring menu item.
The Choose Action page of the Model Refactoring Wizard is displayed:
On this page we select the Table-Per-Concrete-Type Hierarchy (TPC) option, specify the new base class name and click Finish.
Note |
Click the Preview link to preview the new base class properties in the Class Editor dialog box. |
As a result we get a new base class connected with the two existing classes via a TPC inheritance: