.netcore 生成模型

1. 引用    


2. Nuget程序包管理器控制台输入:Scaffold-DbContext "Server=192.168.0.115;Initial Catalog=数据库名字;User ID=sa;Password=123456;MultipleActiveResultSets=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -DataAnnotations -Force

3.如果出现错误PowerShell版本过低,则下载更新地址https://www.microsoft.com/en-us/download/details.aspx?id=34595


猜你喜欢

转载自blog.csdn.net/xml714467338/article/details/80693957