1、安装get包:(1)、Microsoft.EntityFrameworkCore
(2)、Microsoft.EntityFrameworkCore.Tools
(3)、Microsoft.EntityFrameworkCore.sqlServer.Design
(4)、Microsoft.EntityFrameworkCore.sqlServer
2、工具--> NuGet包管理—>程序包管理器控制台
3、在控制台中输入:Scaffold-DbContext "Data Source=.;Initial Catalog=BroadcastScreen;Persist Security Info=True;User ID=sa;Password=wbf2368864112." Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models!!!
Scaffold-DbContext "Data Source=.;Initial Catalog=BroadcastScreen;Persist Security Info=True;User ID=链接数据库的用户名;Password=连接数据库的密码" Microsoft.EntityFrameworkCore.SqlServer -OutputDir 存放文件的文件名