- nuget 命令添加
install-package Microsoft.EntityFrameworkCore
install-package Microsoft.EntityFrameworkCore.SqlServerinstall-package Microsoft.EntityFrameworkCore.Tools
2、执行这一命令。后面是数据库连接字符串(根据数据库生成实体)
Scaffold-DbContext -Force “Data Source=59.110.21.214; Initial Catalog=test_DEV; Persist Security Info=True; User ID=sa; Password=123;” Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models/DataModels
(OutputDir 后面是输出目录)