实体框架:如何防止覆盖“StoreGeneratePattern”更新模型的属性?
在 MSDN(链接)中明确指出 EDMGen.exe 不会生成 StoreGeneratePattern 属性。所以我必须手动添加这个属性。我可以忍受这一点。
我遇到的问题是,EntityTypes 的属性在每次“从数据库更新我的模型”时都会被覆盖。因此,更新后我必须撤消模型中每种类型的这些更改。
有没有办法阻止我的模型自动更新?
In the MSDN (link) it is clearly stated that EDMGen.exe is not generating the StoreGeneratedPattern attribute. So I have to add this attribute manually. I can live with that.
The problem that I have is that the properties of the EntityTypes get overwritten on every "update my model from the database". So I have to undo these changes on every type in my model after an update.
Is there a way to prevent this automatic update of my model?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试此修复。它最初在 VS 2010 SP1 中修复,但修复并不完整,因为很多人仍然遇到这个问题。此修复应该可以解决问题。
Try this fix. It was initially fixed in VS 2010 SP1 but the fix wasn't complete because many people still had this problem. This fix should solve the problem.