An error occurred while updating the entries entity framework
Db Update Exception: An error occurred while updating the entries.
The conflict occurred in database "EF7Test", table "dbo. Sample code below (context constructor just calls base class (DBContext) constructor with the options).
Save Changes(Boolean accept All Changes On Success) at Cms Database Seed. Ensure Seed Data() in Inner Exception 1: Sql Exception: Cannot insert explicit value for identity column in table 'Acls Ref' when IDENTITY_INSERT is set to OFF.
The update operation finish correctly, and the changes are persisted to the database, but I get this exception.
My code is really simple, and I do not try to read anything after the update operation: d__6.
Move Next() --- End of stack trace from previous location where exception was thrown --- at System.
I have a model which contains one-to-many relationship between parent and child nodes (many children for one parent).
When creating a new child and parent and only adding Child to the context.
Execute(IRelational Connection connection) at Microsoft.
Update(IEntity State Manager state Manager, IEntity Adapter adapter) at System.
Save Changes() --- End of inner exception stack trace --- at System.
Few builds after, even though nothing has changed, registering stopped throwing the exception and functions properly.
Exception message: Sql Exception: Cannot update identity column 'Numeric Id'.