title: How to dynamically add entity properties using N-Tier Entity Framework?
body: <p>I would like to know how to dynamically add an undetermined number of unmapped properties to an entity.  We are currently using a DataTable and dynamically adding columns and then binding that table to an UltraGrid; I would like to replicate that with an entity.  Please note that I am using the N-Tier Entity Framework (<a href="https://ntieref.codeplex.com/" rel="nofollow noreferrer">https://ntieref.codeplex.com/</a>).  </p>
  
  <p>I could either dynamically create an entity with properties, or dynamically add properties to an existing entity that does not contain any mapped properties.  Each time the application runs, a different number of properties will be added, so I don’t need to permanently retain new/dynamic properties.  I want to be able to bind the EntitySet as a datasource for an UltraGrid; I will not be utilizing this entity for data modification directly, only accessing the state tracking.</p>
  
  <p>I found a DynamicPropertyHelper class in the N-Tier Entity Framework library but am unable to determine what it is used for.</p>
  
  <p>My entities already inherit from another class and thus cannot inherit from ExpandoObject.</p>
  
  <p>Here are some related posts but I don’t think they are the answer(s) I’m looking for.<br>
  <a href="https://stackoverflow.com/questions/22269176/dynamically-add-new-property-with-any-name-to-object">Dynamically add new property with any name to object</a></p>
  
  <p><a href="http://social.msdn.microsoft.com/Forums/en-US/e9ebabd3-1423-48f5-a57b-cf1248117851/how-do-i-add-a-property-field-at-runtime-in-c?forum=Vsexpressvcs" rel="nofollow noreferrer">http://social.msdn.microsoft.com/Forums/en-US/e9ebabd3-1423-48f5-a57b-cf1248117851/how-do-i-add-a-property-field-at-runtime-in-c?forum=Vsexpressvcs</a></p>
  
  <p>I would like to think that entities have at least as much functionality as datasets… </p>
  
  <p>I would appreciate any assistance, even if the answer is that it can’t be done.</p>
  
  <p>Thank you.</p>