I have 2 tables that I import into an EF model.
The first table has the [section] property, which acts as a foreign key to the second table. When I map this property in the model to the table and try to compile, I get this error:
The problem with displaying fragments on lines 158, 174: Non-primary key columns (sections) [Section] are displayed in both fragments to different conceptual side properties - this mismatch is possible because the corresponding conceptual side of the property can be independently changed.
If I remove this property from the model that it passes, but when I request data, I do not have a section field.
I know that I can get it using the navigation field and reading this property from the second table, but for it to work, I have to include another table in my query.
var res = from name in Context.Table1.Include("Table2")...
Why do I need to enable association for only one field?
UPDATE
To make this clearer:
Table 1 has the fields:
ItemId -
section key - foreign key
name
Table 2 has the fields:
SectionId - key
Name
When I establish associations, the section property from the first table should be removed.
source
share