dbcontext scaffold --ouput-dir 在 Linux 中未按预期工作

dbcontext scaffold --ouput-dir not working as expected in Linux

我运行这个:

❯ 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.

但我的模型中没有创建任何内容,我什至没有收到任何错误。 我尝试了另一个项目,但没有用。

我有金块包裹。

并且 dotnet ef 工作正常。

非常感谢您的帮助,我真的很想在 linux 中使用 netcore。

我现在可以使用 linux 和 dotnet。

删除 Trusted_Connection=true; 成功了

所以这是正确的命令:

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

BeerBrand 在模型中创建,来自我的数据库。