Chapter 4. Querying with LINQ to Entities


This chapter covers
  • Filtering with LINQ to Entities
  • Projecting with LINQ to Entities
  • Sorting and grouping with LINQ to Entities
  • Executing handcrafted SQL code
  • Choosing the fetching strategy


One of the most important features of Entity Framework is the LINQ to Entities query dialect. LINQ to Entities is a specialized version of LINQ that operates on Entity Framework models. LINQ to Entities isn’t a LINQ to SQL competitor—it’s the Entity Framework’s main query language, whereas LINQ to SQL is a full-featured O/RM that shipped with the .NET Framework v3.5.

In this chapter, we’ll begin by looking at how to filter data. Then we’ll cover projecting, grouping, sorting, joining, and querying within inheritance ...

Get Entity Framework 4 in Action now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.