CHAPTER 3

image

Querying an Entity Data Model

In the previous chapter, we showed you many ways to model some fairly common database scenarios. The recipes in this chapter will show you how to query your model. Generally speaking, you can query your model three different ways, using:

  1. LINQ to Entities
  2. Entity SQL
  3. Native SQL

We’ll demonstrate all three approaches in this chapter and, at the same time, cover a wide range of common, and not so common, scenarios that will help you understand the basics of querying models with Entity Framework. We’ll also explore some of the new capabilities for querying data available with Entity Framework 6.

3-1. Querying ...

Get Entity Framework 6 Recipes, Second 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.