Entity Framework Core NuGet packages for Migration
Note: You must install this package by editing the. csproj file; You cannot use the install-package
command or Package Manager GUI.
You can edit the . csproj by right-clicking the project name in the file Solution Explorer and selecting Edit
<itemgroup>
< Span class= "Hljs-tag" > <dotnetclitoolreference include= " Microsoft.EntityFrameworkCore.Tools.DotNet "version=" 2.0.0 "/ >
< Span class= "Hljs-tag" > </ITEMGROUP>
< Span class= "Hljs-tag" > /span>
Enter "CMD" in the Address bar, and then press ENTER.
< Span class= "Hljs-tag" > /span>
< Span class= "Hljs-tag" > Enter the following command in the command window:
dotnet EF Migrations Add initialcreate
Migration for Databases
In the Command window, enter the following command to create the database and table in it.
dotnet ef database update
This is the end.
ASP. NET Core 2.0 EF (MySQL) migration correct posture