保持LinqToSQL同步与数据库 [英] keep LinqToSQL sync with the database
本文介绍了保持LinqToSQL同步与数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我要开发一个新的网站,asp.net 3.5和LinqToSQL。为了维护的目的,我怎么能修改的LINQ类,如果一个属性添加到一个数据库中的表?
I am going to develop a new website with asp.net 3.5 and LinqToSQL. For maintainability purposes, how can I modify a Linq class if an attribute is added to a table in the database ?
感谢你。
推荐答案
不幸的是LinqToSQL没有在Visual Studio中的同步支持。选项有:
Unfortunately LinqToSQL does not have synchronization support in Visual Studio. The options are:
- 表中删除,并重新添加。当然,任何自定义更改将丢失
- 直接编辑.dbml文件文件,并添加属性。该文件包含XML内容并保存时,它会重新生成cs文件。
- 使用3'rd党的加载项,如:
- Remove the table and add it again. Of course any customization changes are lost
- Edit the .dbml file file directly and add the attribute. The file has xml content and when saving it will regenerate the .cs file.
- Use 3'rd party addins like:
- http://www.huagati.com/dbmltools/
- http://www.perpetuumsoft.com/Product.aspx?lang=en&pid=55&tid=linqtosqlsynchronization
这篇关于保持LinqToSQL同步与数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文