项目添加:
Microsoft.EntityFrameworkCore.Tools
Pomelo.EntityFrameworkCore.MySql (这个是第三方的ef mysql 中间件)
Scaffold-DbContext -Force "Server=localhost;User Id=***;Password=****;Database=****" -Provider "Pomelo.EntityFrameworkCore.MySql" -ContextDir Db -OutputDir Models
参考地址:http://www.caotama.com/1404488.htmlhttps://chowdera.com/2022/01/202201050452528768.html