• .NETCore_生成实体


    先安装以下三个包,或者使用Nuget引用 不要问我为什么,按哥说的做吧:

    Install-Package Microsoft.EntityFrameworkCore.SqlServer
    Install-Package Microsoft.EntityFrameworkCore.Tools
    Install-Package Microsoft.VisualStudio.Web.CodeGeneration.Design

    然后包管理控制台默认项目切换到相应项目,运行:

    Scaffold-DbContext "Data Source=192.168.110.129;Initial Catalog=yourDB;User Id=yourUserId;Password=yourPassword" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models

    如果出现以下错误,有时候喝凉水都塞牙:

    The Entity Framework Core Package Manager Console Tools don't support PowerShell version 2.0. Upgrade to PowerShell version 3.0 or higher, restart Visual Studio, and try again.

    意思就是你电脑PowerShell 版本太低了,需要升级:下载地址:https://www.microsoft.com/zh-CN/download/details.aspx?id=40855

    根据不同的系统下载不同的安装包,安装完成后,需要重启电脑即可:

    以上操作记得重启电脑,然后设置你要生成的项目为默认启动项目,再执行以下操作,还不行的话估计是你人品不行,或者长得没我帅。哈哈

     

  • 相关阅读:
    owlsuddimatchmaker安装
    类集
    jsp基本语法
    心得思路记录下
    nyoj517 最小公倍数
    poj1250 Tanning Salon
    poj1686 Lazy Math Instructor
    poj3250 Bad Hair Day
    poj1047 Round and Round We Go
    poj2359 Questions
  • 原文地址:https://www.cnblogs.com/ingstyle/p/10098600.html
Copyright © 2020-2023  润新知