title: Add fields dynamically to a C# Class and use in MVC razor as model
body: <p>I have a class named Agent:</p>
  
  <pre><code>public class Agent
  {
      public string Measure { get; set; }
  }
  </code></pre>
  
  <p>I have a Datatable, whose columns are dynamic (different every time from database except "Measure" column)</p>
  
  <p>For Example:</p>
  
  <pre><code>Measure    |     Dexter     |     Jordon     |     Ana     |     Polark     |
  Login hour        8.7              5.5             7.5            4.8
  </code></pre>
  
  <p>After 10 seconds, the Datatable will have:</p>
  
  <pre><code>Measure    |     Robert     |      Leo       |    Black    |     Operah     |
  Login hour        9.6              5.5             4.3            4.8
  </code></pre>
  
  <p>When the datatable is created. I want to add dynamic properties to the class "Agent" at "Runtime" each time. It should become:</p>
  
  <pre><code>public class Agent
  {
      public string Measure { get; set; }
      public string Dexter { get; set; }
      public string Jordon { get; set; }
      public string Ana { get; set; }
      public string Polark { get; set; }
  }
  </code></pre>
  
  <p>After it is created, I want to Give the class "Agent" to the MVC View as its model. How I can achieve this.</p>
  
  <p>Note: I am a beginner, so please help me out. I can,t find the solution anywhere.</p>