Entity Framework 1.0 (aka 3.5) – Problem in Mapping Fragments
I have an Entity Framework 1.0 (aka 3.5) project (I wish we could upgrade to 4) and I recently got this error:
Problem in Mapping Fragments starting at lines 1987, 2308: Non-Primary-Key column(s) [ColumnBlah] are being mapped in both fragments to different conceptual side properties – data inconsistency is possible because the corresponding conceptual side properties can be independently modified.
It turns out it was caused because the person who created the table didn’t put a foreign key constraint on the column and so I had to add one. When I updated the EF model it saw the constraint and added the corresponding navigation property to the entities BUT it kept the original scalar property and was still mapping it to the table column. So now I had a property in an entity mapped to a column in the underlying table AND a navigation property mapped to the same column.
Simple solution: I deleted the scalar property from the entity.
Hope that helps someone.