How do we map an association with 2 Columns?

Thread is closed for posting
2 posts, 0 answers
  1. Steve
    Steve avatar
    1885 posts
    Member since:
    Dec 2008

    Posted 08 Jun 2017 Link to this post

     

    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?

  2. Steve
    Steve avatar
    1885 posts
    Member since:
    Dec 2008

    Posted 08 Jun 2017 in reply to Steve Link to this post

    .HasConstraint((x, y) => x.EncounterId == y.EncounterId && x.ClerkshipId == y.ClerkshipId) !
Back to Top