Navigation property in derived types

I am new to entity framework and database design and I am using the first database approach, which in Visual Studio 2012 creates POCO classes by default with the DbContext API. I am trying to keep the POCO classes as fast as possible and I ran into a scenario where I want to generate two types from the same table. My problem is I want to move navigation properties along with foreign keys to derived types. Does anyone know a way to solve this problem?

NOTE. I tried to post an image of what I am trying to do, but apparently I still don't have enough reputation to do it.

Edit: Thanks for giving me enough reputation to post the image. The image I'm trying to post is below.

TPH inheritance

Thank,

Raymonda

+3


source to share


1 answer


Have you ever received a solution? I have a similar structure. I created a supertype table in my SQL Server database with two subtypes, one has a relationship to the other table. EF just set it up for me. But you have to do it by right clicking on your entity and adding a new navigation item. Then you can create a new Association (also by right clicking).



Hello

+1


source







All Articles