Error inserting an entity from the Entity Framework [closed]

1

I am trying to perform an insertion of a new entity by means of Entity Framework C# in a table with auto-generated Id, but when calling the method SaveChanges() I receive the following error:

  

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

Reviewing in Database, it is correctly defined as auto-numeric and in .edmx it appears as PK . Any idea where the error may be?

    
asked by Kram_ 20.08.2016 в 08:58
source

1 answer

0

The most likely is that this table is related to another causing the failure to persist, because from what I understand the message it would seem that a relationship with another table is the one that causes the problem.

That's why he mentions the " ReferentialConstraint " error message.

Here

A dependent property in a ReferentialConstraint is mapped to a store-generated column

is the same as commented, validates that the relationships of this table with any other this correct

    
answered by 23.08.2016 в 11:19