The operation failed: The relationship could not be changed because one or more of the foreign-key properties is non-nullable. When a change is made to a relationship, the related foreign-key property is set to a null value. If the foreign-key does not support null values, a new relationship must be defined, the foreign-key property must be assigned another non-null value, or the unrelated object must be deleted.这个泛型错误很烦人,我怎么找出哪个外键失败了呢?
发布于 2016-02-24 13:29:41
据我所知,实际的错误是表中的外键列没有接受null,并且条目没有提供该列的数据。如果您使用过fluent api,一种选择是将IsRequired()更改为IsOptional()以进行外键映射
https://stackoverflow.com/questions/35591130
复制相似问题