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

后端 未结 5 1002
无人及你
无人及你 2021-01-08 01:13

I can\'t figure out why I get this error when I try to add a Venue object and call SaveChanges(). The only difference in the model with Venue objects is they are 1 to 1..0 r

5条回答
  •  生来不讨喜
    2021-01-08 01:32

    I've been suffering with a similar problem. In my case, I'd set up the FK relationship incorrectly and then imported the table with the incorrect FK into my EF model. Despite fixing the FK relationship with the Update Wizard in Visual Studio my correction wasn't picked up.

    To solve this, I deleted the table from the EF model and then re-imported it using the Update Wizard which finally picked up in the change. I hope this helps someone else!

提交回复
热议问题