Linq to SQL 有什么问题?

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

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

Is Unpivot (Not Pivot) functionality available in Linq to SQL? How?(Linq to SQL 中是否提供 Unpivot(非 Pivot)功能?如何?)
How to know if a field is numeric in Linq To SQL(如何在 Linq To SQL 中知道字段是否为数字)
Linq2SQl eager load with multiple DataLoadOptions(具有多个 DataLoadOptions 的 Linq2SQl 急切加载)
Extract sql query from LINQ expressions(从 LINQ 表达式中提取 sql 查询)
LINQ Where in collection clause(LINQ Where in collection 子句)
Orderby() not ordering numbers correctly c#(Orderby() 没有正确排序数字 c#)