Tell me more ×  I am having some trouble understanding when Linq
is giving me an IQueryable result and when it is giving me an
IEnumerable result.  I am using EF and I have two entities
Location and Configuration. Each Location can have multiple
Configurations.  The following query is giving me an IQueryable
as result:  Context.Locations.Where(l => l.Name == "SomeName")
whereas the following is giving me an IEnumerable as result:
Context.Locations.Where(l => l.Name ==
"SomeName").First().Configurations.Select(c => c)  Why is that?
share|improve this question The first query is giving you
IQueryable? Are you positive? That should materialize a single
object, there should be no IQueryable or IEnumerable. – 
user414076 Sep 28 '11 at 14:37 @AnthonyPegram You are right. I
removed the .First() from my example to clarify. –  Nils Magne
Lunde Sep 29 '11 at 10:04 add comment  2 Answers  up vote 4 down
vote accepted  In general, LINQ extension methods on IQueryable
(defined in Queryable) return IQueryables, and the