title: C# Unable to return property dynamically from entity class
body: <p>I'm using entity framework and I'm attempting to return a property from an instance of one of the entity classes representing a table in my database. I keep getting a <code>null</code> value returned. Does it not work on entity classes? I found a couple posts about it on this site and followed them as best I could but to no avail.</p>
  
  <p>I have something like the following:</p>
  
  <pre><code>string propName = "name";
  var itemID = object.GetType().GetProperty(propName).GetValue(object, null);
  </code></pre>
  
  <p>If I replace the <code>.GetProperty().GetValue()</code> part with <code>.GetProperties()</code> I can successfully see all the properties of the object, but when I attempt to get a value from an individual property it's returning <code>null</code> even though there is a value in that field.</p>