|
by Eric Lippert via Fabulous Adventures In Coding on 12/7/2009 2:20:00 PM
As you probably know, there are two ways to write a LINQ query in C#. The way I personally prefer is to use the “query comprehension” syntax:
from customer in customerListwhere customer.City == "London" select customer.Name
Or you can, equivalently, use the “fluent method call” syntax:
customerList.Where(customer=>customer.City == "London").Select(customer=>customer.Name)
These are guaranteed to be equivalent because the compiler simply transforms the former syntax into the latter syntax
... [ read more ]
|