Trying to set-up Entity Framework core in .Net Standard project

前端 未结 7 1552
耶瑟儿~
耶瑟儿~ 2020-12-14 00:39

I was wondering if I could set-up my EntityFrameworkCore in a .NET Standard 2.0 project easily. I was following this Tutorial but it requires either .NET Core or Framework.<

7条回答
  •  旧巷少年郎
    2020-12-14 01:10

    The following works from the dotnet CLI assuming you already have a executable startup project in the solution:

    dotnet ef dbcontext scaffold "Server=myServerName; Database=dbName; User Id=someUser; Password=myPassword123;" Microsoft.EntityFrameworkCore.SqlServer  --project ../MyLibraryProject/ -c MyDbContext -o FolderName
    

    you can find more information here:

    https://docs.microsoft.com/en-us/ef/core/miscellaneous/cli/dotnet#other-target-frameworks

提交回复
热议问题