11

Querying and Manipulating Data Using LINQ

This chapter is about Language INtegrated Query (LINQ) expressions. LINQ is a set of language extensions that add the ability to work with sequences of data and then filter, sort, and project them into different outputs.

This chapter will cover the following topics:

  • Why LINQ?
  • Writing LINQ expressions
  • Using LINQ with EF Core
  • Sweetening LINQ syntax with syntactic sugar
  • Using multiple threads with parallel LINQ (online section)
  • Creating your own LINQ extension methods
  • Working with LINQ to XML

Why LINQ?

The first question we need to answer is a fundamental one: why LINQ?

Comparing imperative and declarative language features

LINQ was introduced in 2008 with C# 3.0 and .NET Framework 3.0. Before that, ...

Get C# 11 and .NET 7 – Modern Cross-Platform Development Fundamentals - Seventh Edition 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.