我正在尝试创建一个模型,使用scaffold:
dotnet ef dbcontext scaffold "DataSource=database.sqlite" Microsoft.EntityFrameworkCore.Sqlite -o Model但是这个返回错误:
Could not scaffold the foreign key 'PoolsInDepartments(pools_id)'. A key for 'id' was not found in the principal entity type 'Pools'.
Could not scaffold the foreign key 'PoolsInDepartments(departaments_id)'. A key for 'id' was not found in the principal entity type 'Departments'.我不理解我的PoolInDepertaments表中的where错误。请查看我的数据库:https://pastebin.com/Mmi6fnrV
此数据库的图表:
发布于 2018-07-08 16:53:20
尝试使用以下命令:
Scaffold-DbContext "Filename=mydatabase.sqlite3“Microsoft.EntityFrameworkCore.Sqlite -OutputDir模型
我从EF Core的第一个版本到新的2.1版本都在使用它,它对我来说是有效的。
https://stackoverflow.com/questions/50819706
复制相似问题