美文网首页
vs2019 core项目命令生成EF实体类

vs2019 core项目命令生成EF实体类

作者: sttone | 来源:发表于2019-10-08 10:45 被阅读0次

    生成MS SQLServer EF

    PM>  Install-Package Microsoft.EntityFrameworkCore.SqlServer   
    PM> Install-Package Microsoft.EntityFrameworkCore.Tools
    PM> Install-Package Microsoft.EntityFrameworkCore.SqlServer.Design
    Scaffold-DbContext "Server=.;Database=st_DB;Integrated Security=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models (-force(重写加这个))
    

    生成MySql EF

    PM>  Install-Package MySql.Data.EntityFrameworkCore -Pre
    PM> Install-Package Pomelo.EntityFrameworkCore.MySql
    PM> Install-Package Microsoft.EntityFrameworkCore.Tools
    PM> Install-Package Microsoft.VisualStudio.Web.CodeGeneration.Design
    PM> Scaffold-DbContext "server=localhost;userid=root;pwd=;port=3306;database=st_film;sslmode=none;" Pomelo.EntityFrameworkCore.MySql -OutputDir EF -Force
    

    相关文章

      网友评论

          本文标题:vs2019 core项目命令生成EF实体类

          本文链接:https://www.haomeiwen.com/subject/xzqmuctx.html