Scaffold-DbContext chokes on unrelated keys

Viewed 32

When I try to scaffold models out of an existing DB2 database, I get this error:

The types of the properties specified for the foreign key {'LIST_ID' : int} on entity type 'BW_LIST_AID (Dictionary<string, object>)' do not match the types of the properties in the principal key {'AUTO_ID' : long} on entity type 'ACCOUNT (Dictionary<string, object>)'. Provide properties that use the same types in the same order.

...when the tables mentioned in the error are not even referencing each other, they are connected only by the parent of the parent of the BW_LIST_AID table, and the parent of the ACCOUNT table.

I'm using this command for scaffolding:

Scaffold-DbContext -connection "myconnstring" -provider IBM.EntityFrameworkCore -context DbcProd -outputdir .\Models -schemas PROD -UseDatabaseNames -NoPluralize -force

I should also mention that EF6 successfully managed to create models and relationships of all tables in the same database.

0 Answers
Related