NuGet:管理控制台
输入:
PM > Scaffold-DbContext "Data Source=127.0.0.1;Initial Catalog=Test1;User ID=sa;Password=123456;MultipleActiveResultSets=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models
//命令格式为:
//Scaffold-DbContext "数据库连接字符串" EF组件名(Microsoft.EntityFrameworkCore.SqlServer/Pomelo.EntityFrameworkCore.MySql/等等) -OutputDir 输出文件夹名称