Creating a TPT Hierarchy via the Model Refactoring Wizard

The following procedure describes how to create a Table Per Type hierarchy using the Model Refactoring Wizard. For the purpose of this example we use the following model containing seven classes connected with one-to-one associations:

images_TPT-Model-Before-EF

We select these classes, call their context menu, and select the Model Refactoring menu item.

The Choose Action page of the Model Refactoring Wizard is displayed:

images_refactoring-wizard-TPT

On this page we select the Table-Per-Type Hierarchy (TPT) option and click Finish.

As a result we get seven classes connected with TPT inheritance; excessive navigation properties are removed from all classes, and the excessive primary key properties are removed from the derived classes:

images_TPT_Model

 


Send feedback on this topic

© 2008 - 2024 Devart. All rights reserved.