LINQ in Action roller

Distinct with Lambda Expressions and Order By

Hi NG, I'm not sure, if this is a beginner question or not. When I select the cities with following code, then they are not sorted. Code Snippet var query = prodDtcx.PersonAddress.Select(adr => adr.City).Distinct(); Now, I want to use OrderBy statement in my lambda expression like this Code Snippet var query = prodDtcx.PersonAddress.Select(adr => adr.City).OrderBy(adr.City) .Distinct(); But, I have no access to the "adr" Element. How can I sort the cities or how can I use order by Read More...
Published Saturday, June 9, 2007 10:09 AM by MSDN Forums: LINQ Project General
Anonymous comments are disabled

Featured Item

This Blog

Sponsoring

Syndication