views:

767

answers:

2

I'm confused about Linq to Entities. Is it the new name of Entity Framework or are they different things?

+3  A: 

LINQ to Entities is really simply the standard LINQ extension methods (Where, OrderBy, etc), when used to query Entity Framework. This isn't the only option; EF can also be queried in a custom dialect of SQL - Entity SQL. In reality, the LINQ extension methods are used to generate Entity SQL, and then that Entity SQL is passed down to the provider.

That way, people implementing a new EF provider (since it is extensible) only have to worry about one thing for query: Entity SQL.

Of course, to strictly count as LINQ, you would need to use the language part too, i.e.

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

etc - but since this boils down to extension methods anyway (on Queryable/IQueryable<T>), most people would count direct extension usage as LINQ - i.e.

var qry = db.Products.Where(x=>x.IsActive).Select(x=>x.Name);
Marc Gravell
+1  A: 

Take a look here: http://naspinski.net/post/Getting-started-with-Linq-To-Entities.aspx

naspinski