What#39;s wrong with Linq to SQL?(Linq to SQL 有什么问题?)
问题描述
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 有什么问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Linq to SQL 有什么问题?


基础教程推荐
- 将数据集转换为列表 2022-01-01
- 从 C# 控制相机设备 2022-01-01
- 在 VB6 或经典 ASP 中使用 .NET 2022-01-01
- 更新 Visual Studio 中的 DataSet 结构以匹配新的 SQL 数据库结构 2022-01-01
- C# 9 新特性——record的相关总结 2023-04-03
- 获取C#保存对话框的文件路径 2022-01-01
- Mono https webrequest 失败并显示“身份验证或解密失败" 2022-01-01
- 如果条件可以为空 2022-01-01
- 重新排序 WPF TabControl 中的选项卡 2022-01-01
- SonarQube C# 分析失败“不是指针的有效行偏移" 2022-01-01