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.
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 unit tests and dotnet-text-xunit
adds tooling support for Visual Studio. Note that the UnitTests
project is a .NET Core App 1.0 (netcoreapp1.0), that Microsoft.EntityFrameworkCore.Design
is configured as a build dependency and Microsoft.EntityFrameworkCore...