官术网_书友最值得收藏!

Installing Entity Framework

The Entity Framework package inclusion and the steps involved were also discussed extensively in Chapter 1, Kickstart - Introduction to Entity Framework Core. So let's focus on the packages that are required for the reverse engineering (database-first approach). The basic package required for the Entity Framework to integrate with SQL Server is as follows:

Add the following command in the PM Console to install the following package:

    Install-Package Microsoft.EntityFrameworkCore.SqlServer

We could also search and install the Microsoft.EntityFrameworkCore.SqlServer package using NuGet Package Manager window:

Microsoft.EntityFrameworkCore.SqlServer NuGet package

The packages required for the reverse engineering (auto-generating the models from the database) are listed below, we could add the following command in the PM Console to install these packages:

    Install-Package Microsoft.EntityFrameworkCore.Tools
Install-Package Microsoft.EntityFrameworkCore.SqlServer.Design

We could also search and install the preceding listed packages using NuGet Package Manager window as shown here:

Microsoft.EntityFrameworkCore.Tools NuGet package

Install the  Microsoft.EntityFrameworkCore.Tools package. This package exposes the Entity Framework commands to the NuGet Package Manager console, with which we could perform certain operations such as scaffolding database context:

Microsoft.EntityFrameworkCore.SqlServer.Design NuGet package

Install the Microsoft.EntityFrameworkCore.SqlServer.Design package. This package lets us scaffold the models from the SQL Server database.

At the time of writing, Microsoft.EntityFrameworkCore.SqlServer.Design 2.0.0 was available only as a preview release.

We have installed the packages required to reverse engineer the existing database entities in EF Core. In the next section, we will start reverse engineering to configure EF Core against the database.

主站蜘蛛池模板: 平阳县| 松桃| 桑植县| 呼和浩特市| 奎屯市| 徐水县| 湾仔区| 新乐市| 磴口县| 新营市| 潼南县| 玉林市| 安阳县| 无为县| 宁安市| 融水| 双柏县| 黔江区| 祁门县| 顺平县| 桐柏县| 酒泉市| 六安市| 墨玉县| 江川县| 东城区| 北碚区| 安图县| 景泰县| 聂荣县| 阿荣旗| 上饶市| 山丹县| 辽宁省| 湛江市| 巴马| 承德市| 垦利县| 尼木县| 巴青县| 兴化市|