实体框架更新edmx创建重复的属性 [英] Entity Framework updating edmx creates duplicate properties

查看:147
本文介绍了实体框架更新edmx创建重复的属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我从数据库更新我的edmx(我添加了多对多关系表中的主键)
我得到重复的属性,如
InstantceType和InstanctType1,对于每次从db刷新,我得到一个新的属性



任何想法是什么导致这个?

解决方案

在添加密钥后,EF模型可能会变得困惑(损坏)。多对多表是有点特别的,因为如果它只包含键,它不会显示为EF图中的实体。



要解决此问题,最简单的解决方案是删除模型,然后重新生成。


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?

解决方案

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.

这篇关于实体框架更新edmx创建重复的属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆