Is LINQ to Dataset a LINQ subset of EF or are the two independent?

Is LINQ to Dataset a LINQ subset of EF or are these two independents?

+4
c # linq linq-to-entities linq-to-dataset
Mar 13
source share
3 answers

Linq works with the queryProviders concept. The query provider is responsible for translating lamba expressions into queries in the data warehouse. as Obalix said in front of me, the Linq to Entities query provider translates linq from lambdas into real sql, which is executed using ado.net core objects. Take a look at the canonical functions here , which are translated into sql (and note which are not). On the other hand, linq to dataset works against the DAtaSet infrastructure. As you recall, the Data Set has some related queries. (getters, updates, delete, inserts) using DataAdapters. Linq queries are mapped to objects that already exist in the data table = columns, etc. SQL queries are not built because the provider does not work at such a low level - the data set is the data abstraction that it uses.

You can take a look at linq in SQL if the agnosticism of the database does not apply to you, and even if some linq provider is for Oracle, if I understood correctly

+3
Mar 13 '10 at 15:35
source share
— -

They are independent.

  • Linq to Dataset works with a DataSet that was previously created using ADO.NET. The dataset is loaded before using linq, so SQL queries are not built dynamically.

  • Linq to EntityFramework works with the framework context. Here, SQL queries are built dynamically based on the Linq query that you specified.

+6
Mar 13 '10 at 14:35
source share

They are independent and do not even work together very well.

LINQ-to-Datatsets is a set of extension methods that allows LINQ queries for data already loaded into DataTables based on IEnumerable. It is close to query List <> and other collections.

LINQ-to-Entities uses query providers and IQueryable to translate LINQ queries into SQL queries. It also provides modeling of database tables as objects.

If you use EF, you can write (much more) Object Oriented using DataSets, while remaining database oriented.

+3
Mar 13 '10 at 17:32
source share



All Articles