首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >外键错误实体框架

外键错误实体框架
EN

Stack Overflow用户
提问于 2016-02-24 08:38:20
回答 1查看 247关注 0票数 1
代码语言:javascript
复制
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.

这个泛型错误很烦人,我怎么找出哪个外键失败了呢?

EN

回答 1

Stack Overflow用户

发布于 2016-02-24 13:29:41

据我所知,实际的错误是表中的外键列没有接受null,并且条目没有提供该列的数据。如果您使用过fluent api,一种选择是将IsRequired()更改为IsOptional()以进行外键映射

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35591130

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档