11

Trying to do Scaffold with the existing database in mac os visual studio using terminal.

Here is the command for the scaffold

dotnet ef dbcontext Scaffold "Server=<servername>;Initial Catalog=<dbName>;Persist Security Info=False;User ID=<rental>;Password=<password>;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"Microsoft.EntityFrameworkCore.SqlServer -o Model

dependencies

error details

But keep getting an error as Missing required argument ''.

https://learn.microsoft.com/en-us/ef/core/miscellaneous/cli/dotnet

https://www.learnentityframeworkcore.com/walkthroughs/existing-database

San Jaisy
  • 15,327
  • 34
  • 171
  • 290

1 Answers1

15

You are missing a space between the connection string and the provider type:

dotnet ef dbcontext scaffold
    "Server=<servername>;…Timeout=30;"Microsoft.EntityFrameworkCore.SqlServer -o Model

                                     ↑↑

So you are only passing a single argument to the command, making the provider name missing.

poke
  • 369,085
  • 72
  • 557
  • 602