ASP.NET Core 3.1 EF CORE 数据迁移

ASP.NET Core 3.1 EF CORE 数据迁移

        最近又开始倒弄Web程序,随笔做做记录,做了记录还是不错的,前面记录了EF在dotnet 2.0的数据迁移。今天正好在研究dotnet3.1 的EF CORE数据迁移,看了前面的记录方便了自己,不知道有没有方便到看官。

            dotnet core 3.1的使用EF做法和前面2.0一样。

           

        前片没要在Web层里面添加包,但是在dotnet 3.1 efcore 里面 就要加一个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.

猜你喜欢

转载自www.cnblogs.com/netren/p/12717955.html