Creating a web service for the Northwind database
We will reference the Entity Framework Core entity data model for the Northwind database that you created in Chapter 12, Introducing Modern Web Development Using .NET:
- In the
Northwind.WebApi
project, globally and statically import theSystem.Console
class, and add a project reference to the Northwind data context class library for either SQLite or SQL Server, as shown in the following markup:<ItemGroup Label="To simplify use of WriteLine."> <Using Include="System.Console" Static="true" /> </ItemGroup> <ItemGroup> <!-- change Sqlite to SqlServer if you prefer --> <ProjectReference Include= "..\Northwind.DataContext.Sqlite\Northwind.DataContext.Sqlite.csproj" /> </ItemGroup>
- Build the
Northwind.WebApi
project and fix any compile errors in your code. - In
Program.cs
, import namespaces for working with the Northwind...