Home > Enterprise >  dbcontext scaffold --ouput-dir not working as expected in Linux
dbcontext scaffold --ouput-dir not working as expected in Linux

Time:02-27

I run this:

❯ dotnet ef dbcontext scaffold 'Server=localhost,1433;Database=Pub;User ID=sa;Password=Banana100;Trusted_Connection=true;TrustServerCertificate=true;' Microsoft.EntityFrameworkCore.SqlServer --output-dir Models
Build started...
Build succeeded.
To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see http://go.microsoft.com/fwlink/?LinkId=723263.

But nothing is created in my Models and I'm not even getting any errors. I tried with another proyects and is not working. enter image description here

I have my nugget packages. enter image description here

And dotnet ef is working fine.

enter image description here

I'd really appreciate some help, I really want to use netcore in linux.

CodePudding user response:

I can now use linux with dotnet.

Removing Trusted_Connection=true; did the trick

So this is the right command:

dotnet ef dbcontext scaffold 'Server=localhost,1433;Database=Pub;User ID=sa;Password=Banana100;TrustServerCertificate=true;' Microsoft.EntityFrameworkCore.SqlServer --output-dir Models

Beer and Brand where created in the models, from my db.

enter image description here

  • Related