参考:

https://docs.microsoft.com/en-us/ef/core/miscellaneous/cli/powershell
https://docs.microsoft.com/zh-cn/ef/core/managing-schemas/scaffolding?tabs=dotnet-core-cli

 

程序包控制台,需要满足项目可编译的条件下才能使用

Scaffold-DbContext -Connection "Server=***;Database=***;uid=***;pwd=***" Microsoft.EntityFrameworkCore.SqlServer -OutputDir "Tables" -UseDatabaseNames -Force -DataAnnotations -Context "_EntitiesContext" -Project "GZImageSearch.Model" -StartupProject "GZImageSearch.Model"

 

在Model模块下运行命令行

dotnet ef dbcontext scaffold "Server=***;Database=***;uid=***;pwd=***" Microsoft.EntityFrameworkCore.SqlServer --output-dir "Tables" --use-database-names --force --data-annotations --context "_EntitiesContext" 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-28
  • 2022-01-01
  • 2021-11-29
猜你喜欢
  • 2022-12-23
  • 2021-06-26
  • 2022-12-23
  • 2021-09-03
  • 2021-12-24
  • 2022-12-23
  • 2021-10-19
相关资源
相似解决方案