title: How I can read EF DbContext metadata programmatically?
body: <p>I have application which uses EF-CodeFirst 5 (dll ver 4.4.0.0, on .net 4.0).</p>
  
  <p>I need to be able to read entity metadata, so that I can, for a given entry type get following information:</p>
  
  <ul>
  <li>which properties are one-many relations (referenced entities)</li>
  <li>which properties are many-one relations (collections of entities referencing current one)</li>
  <li>also nice but not absolutely necessary: which properties are many-many relations (collections of relations)</li>
  </ul>
  
  <p>I can get this info by writing foreach loops on lists of properties and then "recognizing" them by relying on all of the references being virtual, but I feel that is not "proper" way. I know that <code>EdmxWriter</code> can provide that information in xml format, but it does so by accessing InternalContext which is not publicly accessible and I want to get strongly typed lists/arrays directly, without using that xml. Which API should I use (if there is one for this, it seems that I cannot find it)?</p>