EntityFramework类在更新后被删除? [英] EntityFramework classes gets deleted after update?

查看:89
本文介绍了EntityFramework类在更新后被删除?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我更改了我的数据库模型,以便其中一个表外键接受空值。
之后,我去了我的 .edmx 文件,并进行了从数据库更新模型...,保存后,所有我的类文件表示删除



如果我恢复数据库中的更改并重新保存我的 .edmx ,则类将重新出现。但是我真的希望这个外键能够接受null。可能导致这种情况?

解决方案

能够通过重新创建edmx模型来解决它,但是,在错误列表。他们指出一些不再工作的约束[/ p>

I changed my database model so that one of the tables foreign key accepted null values. Afterwards I went to my .edmx file and did the "Update model from database..." and after saving it all my class files representing the tables got deleted automatically.

If I revert my changes in the database and resave my .edmx, the classes will reappear. But I really want this foreign key to be able to accept nulls. What could be causing this?

解决方案

Was able to solve it by recreating the edmx model but yes, there was some error in the error list. They were pointing to some contraints not working anymore

这篇关于EntityFramework类在更新后被删除?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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