LINQ to Objects Overview

Part of what makes LINQ so cool and easy to use is the way it so seamlessly integrates with the C# language. Instead of having an entirely new cast of characters in the form of classes that must be used to get the benefits of LINQ, you can use all of the same collections[] and arrays that you are accustomed to with your preexisting classes. This means you can gain the advantages of LINQ queries with little or no modification to existing code. The functionality of LINQ to Objects is accomplished with the IEnumerable<T> interface, sequences, and the Standard Query Operators.

[] A collection must implement IEnumerable<T> or IEnumerable to be queryable with LINQ.

For example, if you have an array of integers and need it to ...

Get Pro LINQ: Language Integrated Query in C# 2008 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.