这个项目上安装EF Core Database Provider以及相关工具
安装EF Core Database Provider
Entity Framework Core 针对市面上主要的数据库都提供了对应的Provider和对应的NuGet,我们这系列使用SQL Server数据库,因此需要安装SQL Server数据库对应的Provider,我们进入Visual Studio Tools->NuGet Package Manager-> Manage NuGet Packages for Solution,打开NuGet UI,这个是针对整个解决方案
在文本框中输入Microsoft.EntityFrameworkCore.SqlServer 并点击查询,对应的安装将显示在列表中,右侧有个checkbox的选择列表,选中你想要将Package安装到的哪个项目

Core.SqlServer 将安装到你应用程序
你可以在Dependencies > NuGet节点下查看一下刚才安装的包,也可以直接在项目上进行安装(Project > Manage NuGet Packages)
我们还可以使用另外一种方式,在Visual Studio进入Tools > NuGet Package Manager > Package Manager Console 执行命令,这种方式也可以将你的包安装到项目中
Install Package Microsoft.EntityFrameworkCore.SqlServer
安装Entity Framework Core 工具
安装 .NET Core command-line interface (CLI) 工具
首先打开Package Manager Console窗体(Tools->NuGet Package Manager->Package Manager Console),然后运行下面命令安装
dotnet tool install --global dotnet-ef
如果你已经在你的电脑上安装了dotnet ef,可以使用下面命令更新到最新版本
dotnet tool update --global dotnet-ef
dotnet add package Microsoft.EntityFrameworkCore.Design
使用下面命令测试dotnet CLI
PM> dotnet ef

安装Package Manager Console (PMC) tools
Get-Help about_EntityFrameworkCore

这节我们主要讲解在你项目中如何安装EF Core Database Provider和EF Core tools