title: Get field by name in Entity Framework
body: <p>What would be the easiest and least labour intensive (from the software POV) for me to be able to get a property (to be read and modified) from an entity generated via the Entity Framework?</p>
  
  <p>Example (and simplified code) below:</p>
  
  <pre><code>// &lt;auto-generated&gt; from Entity Framework
  public partial class tblCustomer
  {
      public int CustomerID { get; set; }
      public string Status { get; set; }
  }
  </code></pre>
  
  <p>For instance I would like:</p>
  
  <pre><code>tblCustomer customer = new tblCustomer();
  int pCustomerID = customer.GetFieldByName("CustomerID");
  pCustomerID = 100;
  </code></pre>
  
  <p>I've read a lot of answers about Reflection, but also comments that it's heavy processing (may be a bit excessive for my needs).</p>
  
  <p>My example code may seem rather simplistic (so a solution would be rather pointless for that, the real code is based on large tables), but if there was some sort of GetFieldByName function I could reduce my code significantly as I have a lot of repetitious code doing the same stuff (just to different columns).</p>