Install-package Microsoft.EntityFrameworkCore.Design
Install-package Microsoft.EntityFrameworkCore.Tools
Install-package Microsoft.EntityFrameworkCore.SqlServer.Design
完成相关NuGet包安装
Scaffold-DbContext “(数据库连接字符串)” Microsoft.EntityFrameworkCore.SqlServer -OutputDir (实体类模型文件导出文件路径)
举例:SQL Server
Scaffold-DbContext "server=127.0.0.1;Database=XXX;Uid=sa;Pwd=XXXXXX" Microsoft.EntityFrameworkCore.SqlServer -OutputDir D:\XXX\Models