如果从数据库中删除数据库,则每个.edmx的数据库更新模型不会更新模型/列吗? [英] Update model from database per .edmx doesn't update model/cols if deleted from database?

查看:155
本文介绍了如果从数据库中删除数据库,则每个.edmx的数据库更新模型不会更新模型/列吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我从现有数据库模型中的现有数据库中删除列时,右键单击.edmx从数据库更新模型"不会从模型中删除已删除的列(模型和数据库中的列之前但已从db中删除).

When I delete a column from an already existing db from an already existing database model, right clicking on the .edmx "Update model from Database" does not remove deleted columns from the model (column existed in the model and db before but was removed from db) .

我注意到的一件事是我的映射细节与我的.edmx不匹配.映射细节与数据库是最新的,但它们与.edmx的不匹配.

One thing that I have noticed is that my mapping detals are not matching up with my .edmx. Mapping detals are up to date with database but they dont' match that of the .edmx.

这是预期的行为吗?谢谢!

Is this expected behavior? Thanks!

[使用asp.net 4.0/EF4.1]

[Using asp.net 4.0/EF4.1]

推荐答案

我发现,更新基础数据库表时,最好的方法是从edmx设计器中删除映射表,然后执行Update Model from Database

I have found that, when I update the underlying database table, the best approach is to delete the mapped table from the edmx designer, and then do Update Model from Database.

这篇关于如果从数据库中删除数据库,则每个.edmx的数据库更新模型不会更新模型/列吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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