Getting error 3007 when adding my entity model

I get error 3007 when I add my entity model to my solution.

I found these links:

Good explanation

Short answer

About this error:

Error 1 Error 3007: display problem Fragments starting with lines 89, 94: Columns with non-primary keys [Person_ID] display in both fragments different conceptual side properties - data inconsistency is possible because the corresponding conceptual side of the property can be independently changed.

Their answer: I agree with their conclusion that simply by removing the Scalar Property Person_ID and leaving the Navigation property my problem is fixed. However, this is not very scalable, as I dynamically create my database, and my entity is updated very often. I don’t want to go through and clean my object every time I update it.

My question is: Is there a way to fix the error by fixing the way to create an EF object? Or is there a way to remove scalar property through code? Perhaps there are even a few options that I miss.

+6
source share
2 answers

My experience with EF v1 is similar to yours. When the EDM is not generated correctly and you cannot get around the problem, you must manually edit the EDM. EF v.Next (Entity Framework v4, I believe) will support code-only data models, and the EDM designer should be much better. One or the other improvement should make our life easier. Until...

0
source

Try to remove the column of external properties from the Entity set using the construction of the entity model, it will solve your problem.

for example

We have two tables: the client , and the other - the order , when using the entity model, we added a relationship between customers and orders, when we do this Ado.net entity structure, I will add navigation properties for both tables.

Like Customer.Orders - Here is a list of order orders. Customer

One is a lot of relationships.

So, we need to remove the property from the name CustomerId [foreign key column] from the Order set.

For reference:

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

+5
source

All Articles