Solution to error reported by EF (EntityFramework) when inserting or updating data, efentityframework
Error message:Store update, insert, or delete statement affected an unexpected number of rows (0). Entities may have been modified or deleted since entities were loaded. See http://go.microsoft.com/fwlink? LinkId = 472540 for information on understanding and handling optimistic concurrency exceptions.
References:
Https://stackoverflow.com/questions/1836173/entity-framework-store-update-insert-or-delete-statement-affected-an-unexpec
Cause:Auto-increment is not set for primary key id, Leading to insertion failure.
Solution:The table's primary key id is set to auto-increment.
Mysql setting method:Right-click the table and choose design table> select primary key id> select.
Sqlserver setting method:Right-click the table and choose design table> select primary key id. Double-click the value of "(id)" and change it to "yes". Set "id increment" and "id seed" to "1.
The solution to the above EF (EntityFramework) data insertion or update error is to share all the content with you in the editor. I hope you can give us a reference, and hope you can provide more support for the customer's house.