Entity framework database first - Table per hierarchy (TPH) recursive relationship implementation Entity framework database first - Table per hierarchy (TPH) recursive relationship implementation sql sql

Entity framework database first - Table per hierarchy (TPH) recursive relationship implementation


It is not possible for the EF model to automatically deduce that the Derived1RecourseiveId is part of the Derived1 class. But you can move the association in your edmx file manually. Just move the foreign key column, delete the association on your base table and recreate it on the derived. Once moved it will stay in your derived type even if you do a model refresh.