实体框架更新 edmx 会创建重复的属性
当我从数据库更新 edmx 时(我在多对多关系表上添加了主键) 我得到重复的属性,例如 InstantceType 和 InstanctType1,对于数据库的每次刷新,我都会得到一个新属性,
您知道是什么原因造成的吗?
When I update my edmx from database ( I added primary keys on many-to-many relation table)
I get duplicated properties like
InstantceType and InstanctType1, for each refresh from db I get a new property
any idea as to what is causing this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
添加密钥后,EF 模型可能变得混乱(损坏)。多对多表有点特殊,因为如果它只包含键,它不会在 EF 图中显示为实体。
要解决此问题,最简单的解决方案是删除模型然后重新生成。
It is probably that the EF model has become confused (corrupted) after the keys were added. A many-to-many table is a bit special, since it will not show up as an entity in an EF diagram if it only contains keys.
To fix this problem, the simplest solution would be to delete the model and then regenerate it.