Using dotConnect with foreign keys that are compound primary keys?
Posted: Fri 01 Nov 2019 17:42
I'm trialing dotConnect for Oracle, and trying to use it with an old Oracle database that would be difficult to make changes to (it's for medical use).
When I try to generate the data model, I get an error "The relationship XXX has columns that are not part of the key of the table on the primary side of the relationship."
Searching around, this seems to be a problem involving foreign keys and compound primary keys. I have:
So... I'd appreciate any thoughts on any the following:
When I try to generate the data model, I get an error "The relationship XXX has columns that are not part of the key of the table on the primary side of the relationship."
Searching around, this seems to be a problem involving foreign keys and compound primary keys. I have:
- a table "patients" with compound primary key of "patient_id" + "mrn", and
- a second table "visits" with a foreign key to patient.patient_id, and its primary key is this foreign key + visits.visit_id column.
So... I'd appreciate any thoughts on any the following:
- Is there some clever (or straightforward) work-around for this?
- Is it safe to use the generated model without the relationships? Or should i assume that the model is simply broken and not use it? (note that while this is a medical system, the particular application I'm building is not something that will affect safety or change treatments.)
- If we can't get this approach to work, what's the recommended way to access our database from C# without EF?