ASP.net Core 2.0 EF (mysql) Migration correct posture, coremysql

Source: Internet
Author: User

ASP.net Core 2.0 EF (mysql) Migration correct posture, coremysql
Entity Framework Core NuGet package for Migration

Note: You must edit the. csproj file to install this package.Install-packageCommand or package manager GUI.

You can edit. CsprojRight-click the file solution resource manager in the project name and select Edit

<ItemGroup>

<DotNetCliToolReference Include = "Microsoft. EntityFrameworkCore. Tools. DotNet" Version = "2.0.0"/>

</ItemGroup>

Enter "cmd" in the address bar, and then press Enter.

 

Enter the following command in the Command window:

Dotnet ef migrations add InitialCreate

Applicable to database migration

In the command window, enter the following command to create a database and a table.

Dotnet ef database updateThis is the end.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.