This is a migrated thread and some comments may be shown as answers.

How do we map an association with 2 Columns?

1 Answer 16 Views
Data Access Free Edition
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve asked on 08 Jun 2017, 05:36 PM

 

Observation
  - EncounterId (fk)
  - ClerkshipId (fk)
... (others)

 

EncounterClerkship
  - EncounterId (pk)
  - ClerkshipId (pk)

 

So in my observation object I want to have an Association that maps me over to EncounterClerkship, but the double key is messing with my head! :)  Can someone please share the mapping syntax?

1 Answer, 1 is accepted

Sort by
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 08 Jun 2017, 06:53 PM
.HasConstraint((x, y) => x.EncounterId == y.EncounterId && x.ClerkshipId == y.ClerkshipId) !
Tags
Data Access Free Edition
Asked by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Answers by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Share this question
or