Below are two queries that return the same data. Other then style I am not sure which is better.
What factors influence these queries? What are the benefits of us
I think your question is better phrased like this, "What is the difference between IEnumerable
LINQ queries return an IQueryable
Your LINQ query (first example) and your LINQ using method chaining (second example) produce the same result, with different syntax.
It is possible to write a LINQ query as a LINQ method chain and visa versa. It really depends on your preference.
@Lucas: The different is IEnumerableforeach iterator, you are using IEnumerable, and when you are building your query, via either extension methods or using LINQ from o in object synatax, you are building an IQueryable