So, I was browsing the C# 3.0 specification, and I noticed the following:
from c in customers
where c.City == "London"
select c
translates to an invocation of a Where method with a synthesized lambda expression created by combining the iteration variable identifier and the expression of the where clause:
customers.
Where(c => c.City == "London")
Which begs the question:
When [oh when] would I ever want to use the verbose, ugly
from c in customers where c.City == "London" select c
to replace the almost lovely customers.Where(c => c.City == "London") ??? My Answer: Never.
Recent Comments