问题描述
Linq to SQL 有什么问题?
What's wrong with Linq to SQL?
或者 - Linq to SQL 会使其不适用于新项目还是现有项目?我想了解您为什么不为特定项目选择 Linq to SQL - 包括哪些项目参数使其不合适.
Or - what about Linq to SQL would make it unsuitable for a project, either new or existing? I want to hear about why you would not choose Linq to SQL for a particular project - including what project parameters make it unsuitable.
推荐答案
它不太适应数据库架构的变化.您必须重建 dbml 层并重新生成数据上下文.
It is not very adaptable to changes in the database schema. You have to rebuild the dbml layer and regenerate your data contexts.
与任何 ORM 一样(我不会参与关于它是否是 ORM 的争论),您必须知道正在生成什么 SQL,以及这将如何影响您的调用.
Like any ORM (I am not getting into the debate as to whether it is an ORM or not), you do have to be aware what SQL is being generated, and how that will influence your calls.
插入不成批,因此性能成本很高.
Inserts are not batched, so can be high cost in performance.
它正在被 Entity Framework 所取代
It's being sunsetted in favour of Entity Framework
尽管它使用的提供程序模型允许为其他 DBMS 平台构建提供程序,但仅支持 SQL Server.
Despite the fact it is using a provider model that will allow providers to be built for other DBMS platforms, only SQL Server is supported.
[编辑@AugustLights - 根据我的经验:] 延迟加载可能需要一些黑客才能开始工作.
[EDIT @ AugustLights - In my experience: ] Lazy loading may take a bit of hacking to get working.
话虽如此,我认为如果使用得当,它会很方便
That being said, I think it it is very handy if used correctly
这篇关于Linq to SQL 有什么问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!