10

I have a database that has a table with a 2-column primary composite key (one int, one bigint.) I have two tables that have a composite foreign key, referencing the first table's composite primary key. The relationships are (as far as I know,) fine and dandy on the database itself.

When generating a DB context via DB-first EF6, these relationships/navigation properties are not represented in the generated models (No virtual members in the two child tables referencing the parent table.)

Since it's db-first, I can't modify the models.

phil652
  • 1,484
  • 1
  • 23
  • 48
Bryan Morgan
  • 126
  • 6
  • Which database provider do you use? I'm using SQL Anywhere 16 and I am having the same issue. – Rudey Mar 21 '16 at 16:26

1 Answers1

1

In this case you can put those relationships into the onmodelcreating function in db context. We can put constraint there.

Pavvy
  • 353
  • 3
  • 6
  • 15