When I try to add my Entity Model, I get Error 3007.

entity-framework entity-relationship

Question

When I include my entity model into my solution, I see error 3007.

I discovered these links:

decent explanation

Short response

Regarding this error:

Error 1 Error 3007: Problem in Mapping Fragments starting at lines 89, 94: Non-Primary-Key column(s) [Person_ID] 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.

Their Response: I concur with their conclusion that my issue may be resolved by just eliminating the Scalar Property Person ID and leaving the Navigation Property. My database is built dynamically, and my entity is often modified, therefore this is not very scalable. I don't want to always having to clean up my entity after updates.

My inquiry: Is it possible to remedy the issue by altering how EF creates the entity? Or is it possible to get rid of the scalar property using code? Maybe there are even a couple choices that I am missing.

1
6
9/2/2009 7:29:03 PM

Accepted Answer

My EF v1 experience is comparable to yours. You must manually change the EDM if it was created erroneously and there is no way to fix it. The "Code Only" Entity Data Models will be supported by EF v.Next (Entity Framework v4 I think), and the EDM designer is said to be much better. We should all benefit from some kind of improvement. Before then...

0
9/3/2009 1:23:22 PM

Popular Answer

To address your issue, try removing the foreign property column from the entity set using entity model design.

For instance

We have two tables, customer and order, and we established associations between customers and orders using entity model architecture. When we complete this using Ado.net entity framework, I will add navigation properties to both of the following tables.

Similar to Customer.Orders, here's an order list for Customers.Order.

One-to-many relationship

Therefore, we must delete the property from the Order entity set with the name CustomerId[Foreign key column].

For information:

http://social.msdn.microsoft.com/forums/en-US/adodotnetentityframework/thread/2823634f-9dd1-4547-93b5-17bb8a882ac2/



Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow