gpt4 book ai didi

entity-framework - Entity Framework (ASP.NET): How do you update the column mapping after adding a column to the framework?

转载 作者:行者123 更新时间:2023-12-04 07:10:16 32 4
gpt4 key购买 nike

我在实体上添加了一个列,然后从模型中生成数据库或构建解决方案,然后收到一条消息,提示我刚添加的新列未映射。该数据库以前是从模型创建的,没有错误。

当我右键单击Entity并选择Table Mapping时,我可以看到那里的旧列已映射,但是我看不到m的方法

最佳答案

我发现解决该问题而无需“从数据库更新模型”(导致我的旧项目中出现其他问题的原因)的唯一方法是使用XML编辑器编辑.edmx文件,将属性(名称和类型)添加到EntityType 并保存。之后,当我打开.edmx编辑器时,添加的属性就在那里用于映射。

关于entity-framework - Entity Framework (ASP.NET): How do you update the column mapping after adding a column to the framework?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5922274/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com