Querying shadow properties

You heard about shadow properties in Chapter 2, Mapping Entities. In a nutshell, a shadow property is one that belongs to the model, maps to a database column, but has no counterpart in the POCO class: it stays in the shadows. They are useful because, since we do not see them, we can't (easily) tamper with them. But alas, if they do not exist, they cannot be (easily) queried. In this recipe, we will see how.

Getting ready

We will be using the NuGet Package Manager to install the Entity Framework Core 1 package, Microsoft.EntityFrameworkCore. We will also be using a SQL Server database for storing the data, so we will also need Microsoft.EntityFrameworkCore.SqlServer.

Finally, xunit is the package we will be using for the ...

Get Entity Framework Core Cookbook - 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.