irc-netcore-api/IRaCIS.Core.Infra.EFCore/CodeFirst使用说明

27 lines
620 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# 程序包管理控制台使用方式
1、生成迁移文件(add-migration init -Project IRaCIS.Core.Infra.EFCore )
add-migration init
Remove-Migration
# 使用dotnet 命令迁移(dotnet ef dbcontext list -p IRaCIS.Core.Infra.EFCore )
# dotnet ef migrations add 本地迁移名字 -p 项目名 -c 数据库上下文名 -o 迁移文件生成目录
1、生成迁移文件 dotnet ef migrations add Initial -s IRaCIS.Core.API -p IRaCIS.Core.Infra.EFCore -c IRaCISDBContext -o CodeFirst_MSSQL/Migrations
dotnet ef migrations add Initial -p IRaCIS.Core.Infra.EFCore
2、撤销生成的迁移文件
dotnet ef migrations remove -p IRaCIS.Core.Infra.EFCore