.net 6 api引入EF (DB first)

项目添加:
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.html
https://chowdera.com/2022/01/202201050452528768.html
https://www.cnblogs.com/yaopengfei/p/11633385.html

你可能感兴趣的:(.net 6 api引入EF (DB first))