1

I'm trying to scaffold a DB model using DB first with Scaffold-DbContext. The error I get is: The types of the properties specified for the foreign key {'PARTNER_GROUP'} on entity type 'PARTNER' do not match the types of the properties in the principal key {'ID'} on entity type 'STATUS'.

The only relation of STATUS table with PARTNER table is through some other relationships, and the only thing that smells with PARTNER_GROUP(nullable) field is that there is a PARTNER_ID(not null) primary key in the PARTNER table which has different nullability.

gitzko
  • 33
  • 6
  • Read the error message: status.id and partner.partner_group are not the same type – ErikEJ Jan 28 '22 at 15:39
  • There's no way to tell unless you post the table DDL for the tables that generate the scaffolding error. – David Browne - Microsoft Jan 28 '22 at 21:39
  • @ErikEJ status.id and partner.partner_group are completely unrelated id values. It can only be that the status class holds a collection property which holds a property that points to the partner entity. – gitzko Jan 31 '22 at 09:34

0 Answers0