0

I have a hard time finding the syntax for this in .NET EF world

Scaffold-DbContext "Server=server_dns,sql_port;Database=db-name; User ID=sql-account;Password=LeetPa$$w0rd;" -StartupProject Solution.Api Microsoft.EntityFrameworkCore.SqlServer -Context ApiDbContext -ContextDir "Data\Context" -OutputDir "..\Solution.Api.Data.Entities\CRL" -Namespace "Solution.Api.Data.Entities.CRL" -ContextNamespace "Solution.Api.Data.Context" -NoOnConfiguring -Force

This is what I got so far:

dotnet ef dbcontext scaffold "Server=server_dns,sql_port;Database=db-name; User ID=sql-account;Password=LeetPa$$w0rd;" -StartupProject Solution.Api Microsoft.EntityFrameworkCore.SqlServer --context ApiDbContext --context-dir "Data\Context" --output-dir "..\Solution.Api.Data.Entities\DBStuff" -Namespace "Solution.Api.Data.Entities.CRL" -ContextNamespace "Solution.Api.Data.Context" -NoOnConfiguring -Force

Failed on Unrecognized option '-StartupProject'

Dale K
  • 25,246
  • 15
  • 42
  • 71
DoomerDGR8
  • 4,840
  • 6
  • 43
  • 91
  • 1
    For the `dotnet` command line I would imagine that's meant to be `--startup-project` with double dashes at the beginning. Have you run `dotnet ef dbcontext scaffold --help` yet? – AlwaysLearning Nov 07 '22 at 04:51
  • 2
    Consult the [official MS documentation](https://learn.microsoft.com/en-us/ef/core/cli/dotnet) to find out about all the supported options and command line switches. ... – marc_s Nov 07 '22 at 04:52
  • Did you try the first example in Package Manager Console in VS ? – Darkk L Nov 07 '22 at 09:47
  • I ok with Package Manager Console as long as I'm using VS2022. I had to shift to an ad-hoc VM with just VSCode and needed to scaffold in terminal – DoomerDGR8 Nov 09 '22 at 16:56

0 Answers0