【发布时间】:2021-04-04 20:57:39
【问题描述】:
寻找一种从现有 Postgres 13 数据库自动创建实体类的方法。 在
根据
http://www.npgsql.org/efcore/index.html
在 Visual Studio 2019 命令提示符中
dotnet ef dbcontext scaffold "Host=my_host;Database=my_db;Username=my_user;Password=my_pw" Npgsql.EntityFrameworkCore.PostgreSQL
命令应该这样做,但它会抛出错误
Could not execute because the specified command or file was not found.
Possible reasons for this include:
* You misspelled a built-in dotnet command.
* You intended to execute a .NET program, but dotnet-ef does not exist.
* You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
NpgSql.EntityFrameworkCore.PostgreSQL v5.0.1 包是从 Nuget 安装的。
【问题讨论】:
标签: asp.net-core .net-core entity-framework-core visual-studio-2019 npgsql