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

后端 未结 5 1029
无人及你
无人及你 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:36

    OK, adding my experience with this obscure error message:

    I had the same exception and after comparing the database against the EDMX (what a tedious task!!) I found that I mistakenly set a one-to-one relationship the other way around (foreign was primary and primary was foreign).

    Once I fixed that it all worked smoothly!

    Anyway - hopefully my lost 3-4 hours will help someone! :)

提交回复
热议问题