ASP. NET Core 2.0 EF (MySQL) migration correct posture

Source: Internet
Author: User
Tags dotnet

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 updateThis is the end.

ASP. NET Core 2.0 EF (MySQL) migration correct posture

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.