. Net core uses EF core migration for database upgrades

Source: Internet
Author: User
Tags dotnet

---restore content starts---

(1) VS code to create a command that contains the authorization function and uses LOCALDB as the database

dotnet New-au individual-uld--name identitysample

Identitysample for Project name

(2) Create a LOCALDB database connection string in the project's Appsettings.json file after the creation is complete

(3) Execute dotnet EF database update to generate the corresponding table structure for the command execution entity under the current project migrations;

You can add it in the solution file ItemGroup tag.

<dotnetclitoolreference include= "Microsoft.DotNet.Watcher.Tools" version= "2.0.0"/> Run DotNet Restore to install the component The benefits of this component save the file after modifying the CS file, and the service will restart automatically. You will then see the effect immediately: you can then attach to the process in the same way as you would if you want to add a new database column (Model first) in VS code by modifying the entity class, you can do this if we want to generate a table for EF now generated SQL facilitates the creation of libraries and tables in the new environment, which can be done in the following ways: If you want to automatically pre-plug the data into the database when the project starts, you can refer to the following ways: The above data refer to the Ascendas. NET core video material, make an advertisement, the video material link address is: http://vid eo.jessetalk.cn/In addition, when using VS code, you can refer to some of the shortcut key documents, using the following ctrl+shift+p, the command panel input shortcuts press ENTER to see the VS code shortcut detailed description.

. Net core uses EF core migration for database upgrades

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.