Entity Framework The ALTER TABLE statement conflicted with the FOREIGN KEY constraint

后端 未结 11 1801
傲寒
傲寒 2021-02-01 00:34

On updating database in Entity Framework , Code first Migration, I am getting this error:

The ALTER TABLE statement conflicted with the FOREIGN KEY constr

11条回答
  •  再見小時候
    2021-02-01 01:31

    This error can also happen if you have orphan records in the child table. Clean up the database should resolve the issue.

提交回复
热议问题