.NetCore根据数据库生成实体模型Model

MySQL:

Install-Package Microsoft.EntityFrameworkCore.Tools

Install-Package Pomelo.EntityFrameworkCore.MySql

 

打开程序包控制台输入命令

Scaffold-DbContext "Data Source=127.0.0.1;Database=DBName;User ID=user;Password=123456;port=3306;sslmode=none;" Pomelo.EntityFrameworkCore.MySql -OutputDir Models