A dependent property in a ReferentialConstraint is mapped to a store-generated column

后端 未结 13 1475
终归单人心
终归单人心 2020-11-27 17:23

I get this error when writing to the database:

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

13条回答
  •  独厮守ぢ
    2020-11-27 18:02

    I had the same problem. Based on the answers provided here I was able to track it and solve it, but I had a strange issue described below - it might help somebody in the future.

    On my dependent tables, the foreign Key columns have been set to StoreGeneratedPattern="Identity". I had to change it to "None". Unfortunately, doing so inside designer didn't work at all.

    I looked in the designer-generated XML (SSDL) and these properties were still there so I removed them manually. I also had to fix the columns on the database (remove the Identity(1,1) from CREATE TABLE SQL)

    After that, the problem went away.

提交回复
热议问题