title: Read foreign key metadata programatically with Entity Framework 4
body: <p>Does anyone know how one goes about obtaining the schema information out of an edmx generated Entity Framework?</p>
  
  <p>Specifically I want to manage to traverse the foreign key for an entity that I don't currently have an instance of and get the it's foreign key relationships, and I want to do this via reflection in a way that'll be generically applied to any entity class without custom code each time.</p>
  
  <p>EG: My schema has 2 classes, User and Group. I have the number "42" that I know came from the "GroupId" property of a "User" entity, but at the moment I can't work out how to detect that this "GroupId" property of "User" foreign keys to the "Group" entity by it's "GroupId" property.</p>