title: c# - Cannot convert from List<DateTime?> to List<dynamic>
body: <p>I am trying to create an attribute in a list that takes different types. This is my class:</p>
  
  <pre><code>public class ChartData
  {
      public string id { get; set; }
      public List&lt;dynamic&gt; data { get; set; }
  
      public ChartData()
      {
      }
  
      public ChartData(string id, List&lt;DateTime?&gt; data)
      {
          this.id = id;
          this.data = data;
      }
  }
  
      public ChartData(string id, List&lt;float?&gt; data)
      {
          this.id = id;
          this.data = data;
      }
  
      public ChartData(string id, List&lt;int?&gt; data)
      {
          this.id = id;
          this.data = data;
      }
  </code></pre>
  
  <p>In the code I use the <code>data</code> list to store <code>DateTime?</code>, <code>float?</code> or <code>int?</code> data. What do I do to be able to store these different types in one class attribute?</p>
  
  <p>I am getting the error: </p>
  
  <pre><code>Argument 2: cannot convert from 'System.Collections.Generic.List&lt;System.DateTime?&gt;' to 'System.Collections.Generic.List&lt;dynamic&gt;'
  </code></pre>