title: How can I get the Primary Key from a new TElement?
body: <p>I have a generated class from an .edmx file:</p>
  
  <pre><code>public class User
  {
      public int IDIsItMe { get; set; }
      public int IDOrMe { get; set; }
  }
  </code></pre>
  
  <p>I want to create a method to return the primary key.</p>
  
  <pre><code>public object GetPrimaryKey&lt;T&gt;(T element) where T: class
  {
      // something
  }
  </code></pre>
  
  <p>So if I do</p>
  
  <pre><code>var u = new User();
  GetPrimaryKey(u);
  </code></pre>
  
  <p>I will get the primary key value.</p>
  
  <p>How can I do that using Entity Framework 6?</p>