Foreign key constraint, EF with collection of childobjects

后端 未结 4 1441
遥遥无期
遥遥无期 2021-01-27 09:31

I\'m trying to update a model, but get the error \"The operation failed: The relationship could not be changed because one or more of the foreign-key properties is non-nullable.

4条回答
  •  渐次进展
    2021-01-27 09:59

    As the exception say it seams like your associated collections or other associated objects cant find a valid ID value.

    Are you Eager-loading the associated objects? like Customer?

提交回复
热议问题