O'Reilly logo

Visual C#® 2012: How to Program, Fifth Edition by Harvey Deitel, Paul Deitel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

9.6. Wrap-Up

This chapter introduced LINQ (Language Integrated Query), a powerful feature for querying data. We showed how to filter an array or collection using LINQ’s where clause, and how to sort the query results using the orderby clause. We used the select clause to select specific properties of an object, and the let clause to introduce a new range variable to make writing queries more convenient. The StartsWith method of class string was used to filter strings starting with a specified character or series of characters. We used several LINQ extension methods to perform operations not provided by the query syntax—the Distinct method to remove duplicates from the results, the Any method to determine if the results contain any items, and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required