If I have 2 tables 1 with a composite primary key where one of the keys is also a foreign key in another table:
Table 1:
- A (PK, FK - maps to X in Table 2)
- B (PK)
- C
Table 2:
- X (PK)
- Y
Because A is both the PK in table 1 and FK in table 2, when I use EF to generate the entity model, I have both a Scalar AND a Navigation property for A in table 1. I cannot seem to remove A as a scalar (I think because it is a primary key).
The problem I am having is that if I create a table1Entity and set A's scalar property to a new value, A's navigation property will not be changed automatically (and vice versa).
Ideally I just want A to expose the navigation property - which is the way it behaves if A was not also part of the composite primary key anyway. Is there any way to achieve this?