mercredi 21 juin 2017

EF6 Retrieving foreign key names from navigation property

I am trying to extract the structure of the entities in EF using reflection and then recreate it in memory (using DataSet) on a remote station.
I've managed to retrieve most of the information i need but i stumbled upon the relation between two entities using the navigation properties.
What I want to retrieve is the association between the entities and, from that association, the foreign key that constructs that association.
Given the structure from a Database First edmx:

enter image description here

I want to get the relation between the two tables that construct the navigation property "Versions"
I've noticed that this information is found in the edmx file under the association zone in the principal/dependent nodes enter image description here
but i cannot seem to obtain that same information in code in the RelationshipType property or in any other property enter image description here

Could you give me some help on how to proceed?
Thank you





Aucun commentaire:

Enregistrer un commentaire