Projecting entities with Select

To learn about projection, it is best to have some more complex sequences to work with; so, in the next project, we will use the Northwind sample database.

Add a new console application project named Ch09_Projection.

In Visual Studio 2017, in the Ch09_Projection project, right-click Dependencies and choose Manage NuGet Packages. Search for the Microsoft.EntityFrameworkCore.SqlServer package and install it.

If you did not complete Chapter 8, Working with Databases Using the Entity Framework Core, then open the Northwind.sql file and right-click and choose Execute to create the Northwind database on the server named (localdb)\mssqllocaldb.

In Visual Studio Code, modify the Ch09_Projection.csproj file as highlighted in ...

Get C# 7 and .NET Core: Modern Cross-Platform Development - 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.