本文介绍了管理Linq到SQL Dbml文件的最佳实践?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始使用Linq to SQL,我想知道是否有人可以共享任何最佳实践来管理dbml文件.

I've just started using Linq to SQL, and I'm wondering if anyone has any best practices they can share for managing dbml files.

  • 如何使它们与数据库保持最新?
  • 对于整个数据库,您是否只有一个dbml文件,还是将其拆分为多个逻辑单元?
  • 在团队环境中如何管理此文件?

欢迎其他提示和技巧.

推荐答案

您是否看过 SqlMetal ?它得到了官方的支持,尽管没有得到太多的提升.您可以从命令行使用它来构建dbml-我们已将其用作数据库的持续集成更新的一部分(尽管这样做,请确保您具有很好的代码分离能力-部分类是一个救星-因为dbml会得到覆盖).

Have you looked at SqlMetal? It's officially supported, although not promoted too much. You can use it to build dbmls from the commandline - we've used it as part of a db's continous integration updates (make sure you have really good code separation if you do this though - partial classes are a saviour - as the dbml will get overwritten).

如果我没记错的话,它没有与Visual Studio中的模型设计器完全相同的功能(我认为它对多元的处理方式不同).在Ben Hall的博客上有一个关于它的好帖子

If I recall correctly it doesn't have quite the same features as the model designer in Visual Studio (I think it handles pluralisation differently). There a good post about it on Ben Hall's blog.

这篇关于管理Linq到SQL Dbml文件的最佳实践?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-26 11:57