LINQ is not limited to querying arrays of simple types such as
ints. It can be used with most data types, including
strings and user-defined classes. It cannot be used when a query does not have a defined meaning—for example, you cannot use
orderby on objects that are not comparable. Comparable types in .NET are those that implement the
IComparable interface, which is discussed in Section 20.4. All built-in types, such as
IComparable. Figure 9.3 presents the
Employee class. Figure 9.4 uses LINQ to query an array of
1 // Fig. 9.3: Employee.cs 2 // Employee class with FirstName, LastName and MonthlySalary ...