是什么"之间的差异;以实体LINQ"," LINQ to SQL的"和" LINQ到数据集"
我已经工作了相当长一段时间,现在使用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。
我知道有很多信息来源在那里,但我正在寻找一个样的小抄,它指示一个新手到哪里前往一个特定的目标。
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到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到实体是同样的想法,但会在后台使用实体框架,作为ORM - 再从微软,但支持多种数据库后端
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到数据集是LINQ,但使用是违反旧式ADO .NET 2.0数据集 - 在时代之前,ORM的来自微软,你可以使用ADO.NET做返航数据集,数据表等,并LINQ到数据集查询这些数据存储数据。因此,在这种情况下,你会从后台数据库返回的DataTable或数据集(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