1

Looking for a method to automatically create entity classes from existing Postgres 13 database. in

According to

http://www.npgsql.org/efcore/index.html

In Visual Studio 2019 command prompt

dotnet ef dbcontext scaffold "Host=my_host;Database=my_db;Username=my_user;Password=my_pw" Npgsql.EntityFrameworkCore.PostgreSQL

Command should do this but it throws error

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 package is installed from Nuget.

1 Answer 1

4

You should install Dotnet EF tool.

try this in your package manager console

dotnet tool install --global dotnet-ef

After that it is recommended to install design tool aswell so you can use tools on specific project

dotnet add package Microsoft.EntityFrameworkCore.Design
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.