ASP.NET Core 3.1 EF CORE data migration

ASP.NET Core 3.1 EF CORE data migration

        Recently, I started to fiddle with Web programs. I made notes on the essays, and the records were good. The data migration of EF in dotnet 2.0 was recorded earlier. Today, I am just studying the EF CORE data migration of dotnet3.1. It is convenient for me to read the previous records. I do n’t know if it is convenient to see the officer.

            The practice of using EF with dotnet core 3.1 is the same as the previous 2.0.

           

 

        The first film does not need to add a package in the Web layer, but in dotnet 3.1 efcore, you need to add a Design.

        不然在使用 add-migration会报:Your startup project 'JC.CMS.Web' doesn't reference Microsoft.EntityFrameworkCore.Design. This package is required for the Entity Framework Core Tools to work. Ensure your startup project is correct, install the package, and try again.

 

Guess you like

Origin www.cnblogs.com/netren/p/12717955.html