Chapter 9. Querying and Manipulating Data with LINQ

This chapter is about Language Integrated Queries (LINQ), language extensions that add the ability to work with sequences of items and filter, sort, and project them into different outputs.

This chapter covers the following topics:

  • Writing LINQ queries
  • Using multiple threads with Parallel LINQ
  • Creating your own LINQ extension methods
  • Working with LINQ to XML

Writing LINQ queries

In the previous chapter, you wrote a few simple LINQ queries, but I didn't properly explained how LINQ works.

LINQ has several parts; some are required and some are optional:

  • Extension methods (required): These are Where, OrderBy, Select, and so on. These provide the functionality of LINQ.
  • LINQ providers (required): LINQ to Objects, ...

Get C# 6 and .NET Core 1.0: Modern Cross-Platform Development 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.