Using LINQ with EF Core
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.
- Create a new console application project named
LinqWithEFCore
, add it to the workspace for this chapter, and select the project as active for OmniSharp. - Modify the
LinqWithEFCore.csproj
file, as shown highlighted in the following markup:<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>netcoreapp3.0</TargetFramework> </PropertyGroup> <ItemGroup> <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.0.0" /> </ItemGroup> </Project>
- In Terminal, download the referenced package and compile the current project, as shown in the following command:
dotnet build
- Copy the
Northwind.sql
file into...