在Designer中刷新LinQ2SQL模型而不会丢失所有属性 [英] Refreshing LinQ2SQL Model in Designer without losing all Properties

查看:90
本文介绍了在Designer中刷新LinQ2SQL模型而不会丢失所有属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我在当前的应用程序中大量使用LinQ2SQL,尽管我在部分类中拥有大多数东西,但是某些事情必须在VS Designer中进行调整(例如我包装的字段的访问器).然后,有时我希望在模型中对字段的命名与在数据库中对字段的命名不同.

so I'm using LinQ2SQL quite heavily in my current application, and although I have most stuff in partial classes, some things have to be adjusted in the VS Designer (like Accessors for fields I wrap). Then, sometimes I like to name Fields differently in the Model than they do in the DB.

所以,我现在的问题是.回到更改已知表时,我只有两个选择:

So, my problem now is. When going back to changing a already known table I have only two options:

  • 通过 手动设计器
  • 从模型中删除表,然后从Server Explorer中将其重新导入(丢失属性)
  • Introduce new fields through the designer manually
  • Delete the Table from the Model and newly import it from Server Explorer (losing properties)

两种方法都不令人满意.我是否错过了一个秘密按钮,上面写着只是刷新更改"?我的意思是,该模型知道所有映射,从数据库中获取新内容并不难.

Both ways are unsatisfactory. Is there some secret button I missed out that says "just refresh changes?" I mean, the model knows all mappings, it can't be that difficult to just get new things from the DB.

有什么办法解决这个问题?

Any ways around this?

推荐答案

请参见基本上,这不是在VS2008中实现的.不要问我为什么,也许MS的人太忙了,以至于他们完全忘记了这个重要功能.

Basically this isn't implemented in VS2008. Don't ask me why, maybe the guys at MS were so occupied that they completely forgot about this important feature.

这篇关于在Designer中刷新LinQ2SQL模型而不会丢失所有属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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