1

I have an entity that has a primary key that is set to identity and the type is bigint (long in C#).

When I add a new object to ObjectContext and try to save changes to the database, I get the following error:

A dependent property in a ReferentialConstraint is mapped to a store-generated column. Column: 'Id'."

I don't really understand what's going on here. True, the identity column is set to 0 by default upon creation, but that shouldn't be preventing EF from figuring out it's an identity field.

What's going on here?

Thank you

1 Answer 1

2

Well, apparently someone created a strange bidirectional relationship between tables that wasn't even supposed to be there.

I deleted it and it's working now.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.