Differences between query using LINQ and IQueryable interface directly?
- by JohnMetta
Using Entity Framework 4, and given:
ObjectSet<Thing> AllThings = Context.CreateObjectSet<Thing>;
public IQueryable<Thing> ByNameA(String name)
{
IQueryable<Thing> query = from o in AllThings
where o.Name == name
select o;
return query;
}
public IQueryable<Thing> ByNameB(String name)
{
return AllThings.Where((o) => o.Name == name);
}
Both return IQueryable< instances, and thus the query doesn't hit the server until something like ToList() is called, right? Is it purely readability that is the difference, or are the using fundamentally different technologies on the back-end?