On your project install the following NuGet Packages
- Microsoft.EntityFrameworkCore
- Microsoft.EntityFrameworkCore.Design
- Microsoft.EntityFrameworkCore.Relational
- Microsoft.EntityFrameworkCore.SqlServer -- Provider based
- Microsoft.EntityFrameworkCore.Tools -- (optional)
Installing the packages using Package Manager Console (Tools > NuGet Package Manager > Package Manager Console)
- Make sure you are in the correct directory by typing in dir then press enter.
- Install-Package <Package Name>
Installing the packages using Visual Studio's NuGet Package Manager
- Go to Tools > NuGet Package Manager > Manage NuGet Packages for Solution
- Search for Microsoft.EntityFrameworkCore
Installing the packages by editing the Project (Visual Studio 2017)
Another way of installing the EF packages is by editing the project. Paste in the following inside the <Project> scope.
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="2.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.0.3" />
</ItemGroup>
Save project then on the Package Manager Console, enter the command below to restore the packages to the project:
> dotnet restore
Save project then on the Package Manager Console, enter the command below to restore the packages to the project:
> dotnet restore
No comments:
Post a Comment