I'm trying to create an MVC project using Datbase First Modelling in Entity Framework. The issue I have is when I have selected the tables I wish to use, the models are created but relationships are not generated. I have read somewhere that EF does not work well with composite keys which unfortunately a number of my tables are made up of.
I tried adding the associations myself through the designer but because my table has a composite key and its mapping to a table on the first portion of the composite key to a column on another table I get an error. This is because it insists on having a mapping for the second item of the composite key e.g.
Table 1 Table 2
D_ID A_ID
FC SomeField
Description SomeField
etc... D_ID
I need to map Table 1 and 2 based on D_ID but Table 1 is made up of a composite Key of D_ID & FC
Using database first how do I get around this?
Thanks