Chapter 6. LINQ to Object
In This Chapter
Working with objects in LINQ
Developing a simple object query
Using deferred operators
Developing a deferred operator application
Using nondeferred operators
Developing a nondeferred operator application
Objects (from a LINQ perspective) can refer to any elements that implement the IEnumerable interface in your application. For example, an object can include an array, a DataSet, a database, or even a control when it supports the correct interface. You can even create custom classes to support the IEnumerable interface and interact with them as objects in LINQ. The LINQ to Object provider is the most generic provider that you'll use. You use this provider to perform any task with LINQ — the other providers add to the functionality provided by the LINQ to Object provider. Consequently, this is the most important provider to know about because it affects everything you do.
The examples in Chapters 1 through 5 rely on the LINQ to Object provider. However, these examples show only the basics of what you can do with this provider. The purpose of this chapter is to move from the basics into some more advanced examples of how you can use this provider to work with objects of various sorts.
Besides looking at some of the interesting tasks you can perform with the LINQ to Object provider, this chapter also begins a discussion of operators. Operators include keywords, such as from
and select
, and methods of interpreting the data. Table 2-1 provides a list of ...
Get LINQ For Dummies® 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.