ADO.NET Entity Framework and Linq for Objects

I got confused in Linq for Entities. Is this the new Entity Framework name or are they different?

+3
source share
2 answers

LINQ to Entities are really just the standard LINQ extension methods (Where, OrderBy, etc.) when they are used to query the Entity Framework. This is not the only option; EF can also be requested in the SQL custom dialect - Entity SQL . In fact, LINQ extension methods are used to generate Entity SQL, and then this Entity SQL is passed to the provider.

As such, people introducing the new EF provider (as it is extensible) need only worry about one thing for the query: Entity SQL.

Of course, in order to strictly count as LINQ, you will also need to use part of the language, i.e.

from product in db.Products
     where product.IsActive
     select product.Name;

etc., but since it still comes down to extension methods (in Queryable/ IQueryable<T>), most people will consider using direct extension as LINQ - i.e.

var qry = db.Products.Where(x=>x.IsActive).Select(x=>x.Name);
+4
source

All Articles