Lambda Expressions a writing anonymous methods:
IEnumerable <person> results = people.Where(p => p.LastName == "Zeng");
Convent to inline methods:
IEnumerable <Person> results = people.Where( delegate (Person p){return p.LastName = ="Zeng";}
) ;
IEnumerable<Person> advanceResults = people.Where(p => p.LastName == "Zeng")
.OrderBy(p => p.FirstName)
.Take(2);
Monday, April 7, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment