管理 Linq to SQL Dbml 文件的最佳实践? [英] Best Practices for Managing Linq to SQL Dbml Files?

查看:23
本文介绍了管理 Linq to 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 文件,还是将其拆分为多个逻辑单元?
  • 如何在团队环境中管理此文件?

欢迎提供任何其他提示和技巧.

Any other tips and tricks welcome.

推荐答案

你看过 SqlMetal?它得到了官方支持,虽然没有得到太多宣传.您可以使用它从命令行构建 dbmls - 我们已经将它用作 db 持续集成更新的一部分(如果这样做,请确保您有非常好的代码分离 - 部分类是一个救星 - 因为 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 to SQL Dbml 文件的最佳实践?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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