Search code examples
c#linqlinq-to-entitieslinq-to-dataset

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


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


Solution

  • Linq works with the concept of queryProviders. The query provider is responsible for translating the lamba expressions into queries on the underlying data store. as Obalix said before me Linq to Entities query provider translates the linq with lambdas into real sql which is executed using underlying ado.net objects. Take a look at canonical functions here, which are translated into sql (and take notice which are not). On the other hand linq to dataset works against DAtaSet infrastructure. As you may remember Data Set has some queries associated with it. (getters, updates, deletes, inserts) with the usage of the DataAdapters objects. Linq queries are mapped onto objects that already exist in the dataset = tables, columns etc. The SQL queries are not built, because the provider does not operate at such a low level - the data set is the data abstraction it uses.

    You might take a look at linq to SQL if Database agnosticism is not You concern, and there is even some provider linq to Oracle if I heard correctly.