1.根据数据库生成实体类 Models
Scaffold-DbContext "Data Source=.;Initial Catalog=TEST;User ID=sa;Password=pwd;TrustServerCertificate=True" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -Force
2.根据数据表生成实体类 Models
Scaffold-DbContext "Data Source=.;Initial Catalog=TEST;User ID=sa;Password=pwd;TrustServerCertificate=True" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -Force -Tables tbTEST
标签:实体类,NetCore,Models,Scaffold,DbContext,生成,数据库 From: https://www.cnblogs.com/microsoft-zh/p/17504210.html