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
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
The above Scaffold-DbContext command creates entity classes for each table in the SchoolDB database and context class (by deriving DbContext ) with Fluent API configurations for all the entities in the Models folder. The following is the generated Student entity class for the Student table.
Update the toolsUse dotnet tool update --global dotnet-ef to update the global tools to the latest available version. If you have the tools installed locally in your project use dotnet tool update dotnet-ef . Install a specific version by appending --version <VERSION> to your command.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With