title: How to add object to a generic List<T>
body: <p>I'm reading from a database and trying to store the current record in an instance of my object.  How can I add a new item to my list?  </p>
  
  <pre><code>private void Load_data&lt;T&gt;(AseDataReader reader, List&lt;T&gt; table)
      {
          while (reader.Read())
          {
              table.Add(new myclass1
              {
                  id_number= SafeGetInt(reader, 0),
                  state = SafeGetString(reader, 1)
              });
          }
      }
  </code></pre>
  
  <p>The "table.Add(new myclass1" is the issue for the compiler.  More specifically the, "myclass1".  I'm new to generics.  How can I do this?  Is it possible?</p>
  
  <p>Update:  Okay so I'm calling the above method when I get to the point in my code that I know what type it needs to be.  I'm using a method one level up from this that accepts all list types - so I don't need to have 12 overloaded methods that do the same thing.</p>