Cannot add an entity with a key that is already in use (LINQ)

后端 未结 4 774
一向
一向 2020-12-22 04:36

I get this error Cannot add an entity with a key that is already in use. when I run the code below.

Tables:

4条回答
  •  萌比男神i
    2020-12-22 05:16

    Seems you are missing primary key or an unique key on CMSPageObject table. Please try to verify the keys in the database. I had same issue since I had missed the PK on the table.

    Cheers.

提交回复
热议问题