管理Linq到SQL Dbml文件的最佳实践? [英] Best Practices for Managing Linq to SQL Dbml Files?
问题描述
我刚刚开始使用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文件,还是将其拆分为多个逻辑单元?
- 在团队环境中如何管理此文件?
欢迎其他提示和技巧.
推荐答案
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文件的最佳实践?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!