“LINQ to Entities"、“LINQ to SQL"有什么区别?和“LINQ to Dataset"

What is the difference between quot;LINQ to Entitiesquot;, quot;LINQ to SQLquot; and quot;LINQ to Datasetquot;(“LINQ to Entities、“LINQ to SQL有什么区别?和“LINQ to Dataset)
本文介绍了“LINQ to Entities"、“LINQ to SQL"有什么区别?和“LINQ to Dataset"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用 LINQ 工作了很长时间.然而,所提到的 LINQ 风格之间的真正区别是什么仍然是一个谜.

I've been working for quite a while now with LINQ. However, it remains a bit of a mystery what the real differences are between the mentioned flavours of LINQ.

成功的答案将包含它们之间的简短区别.每种风味的主要目标是什么,有什么好处,是否对性能有影响...

附:我知道那里有很多信息来源,但我正在寻找一种备忘单",它可以指导新手去哪里实现特定目标.

P.S. I know that there are a lot of information sources out there, but I'm looking for a kind of a "cheat sheet" which instructs a newbie where to head for a specific goal.

推荐答案

  • 它们都是 LINQ - 语言集成查询 - 所以它们都有很多共同点.所有这些方言"基本上都允许您对来自各种来源的数据进行查询式选择.

    • all of them are LINQ - Language Integrated Query - so they all share a lot of commonality. All these "dialects" basically allow you to do a query-style select of data, from various sources.

      Linq-to-SQL 是微软首次尝试 ORM - 对象关系映射器.它仅支持 SQL Server.这是一种将 SQL Server 数据库表映射到 .NET 对象的映射技术.

      Linq-to-SQL is Microsoft's first attempt at an ORM - Object-Relational Mapper. It supports SQL Server only. It's a mapping technology to map SQL Server database tables to .NET objects.

      Linq-to-Entities 是相同的想法,但在后台使用实体框架,作为 ORM - 再次来自 Microsoft,但支持多个数据库后端

      Linq-to-Entities is the same idea, but using Entity Framework in the background, as the ORM - again from Microsoft, but supporting multiple database backends

      Linq-to-DataSets 是 LINQ,但使用的是针对旧式"ADO.NET 2.0 数据集的 - 在 Microsoft 推出 ORM 之前的时代,你可以做的只是ADO.NET 返回 DataSets、DataTables 等,Linq-to-DataSets 查询这些数据存储以获取数据.因此,在这种情况下,您将从数据库后端返回一个 DataTable 或 DataSets(System.Data 命名空间),然后使用 LINQ 语法查询它们

      Linq-to-DataSets is LINQ, but using is against the "old-style" ADO.NET 2.0 DataSets - in the times before ORM's from Microsoft, all you could do with ADO.NET was returning DataSets, DataTables etc., and Linq-to-DataSets queries those data stores for data. So in this case, you'd return a DataTable or DataSets (System.Data namespace) from a database backend, and then query those using the LINQ syntax

      这篇关于“LINQ to Entities"、“LINQ to SQL"有什么区别?和“LINQ to Dataset"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

DispatcherQueue null when trying to update Ui property in ViewModel(尝试更新ViewModel中的Ui属性时DispatcherQueue为空)
Drawing over all windows on multiple monitors(在多个监视器上绘制所有窗口)
Programmatically show the desktop(以编程方式显示桌面)
c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
LINQ many-to-many relationship, how to write a correct WHERE clause?(LINQ多对多关系,如何写一个正确的WHERE子句?)