title: Must be a non abstract type with public parameterless constructor
body: <p>I read the answers to some similar questions to mine but couldn't find a good explanation to my case. Please, correct me, if I'm wrong :)</p>
  
  <p>I have three classes - a base abstract class, called EmailData, and two other classes that derive from the base class. I have not included one of the inheriting classes and most of the members of the other classes to make the example more obvious.</p>
  
  <pre><code>private abstract class EmailData
      {
          public EmailData(DataRow emailDataRow)
          {
              vehicleOwner = emailDataRow["owner"].ToString();
          }
  
          public string VehicleOwner { get { return vehicleOwner; } }
  
          private string vehicleOwner;
      }
  
      private class DeliveryEmailData : EmailData
      {
          public DeliveryEmailData(DataRow deliveryData)
              : base(deliveryData)
          {
              orderNumber = deliveryData["ordernumber"].ToString();
          }
  
          public string OrderNumber { get { return orderNumber; } }
  
          private string orderNumber;
      }
  </code></pre>
  
  <p>I have a generic class, that uses one of the two classes that derive from the base class EmailData, and looks like this:</p>
  
  <pre><code>private class Email&lt;T&gt; where T : EmailData, new()
      {
          public Email(DataTable emailDataTable)
          {
              // Get the number of rows.
              int rowsNumber = emailDataTable.Rows.Count;
  
              emailsData = new T[rowsNumber];
  
              for (int i = 0; i &lt; rowsNumber; i++)
              {
                  // Store the appropriate data in the arrays.
                  emailsData[i] = (T)Activator.CreateInstance(typeof(T), emailDataTable.Rows[i]);
              }
  
              // Get the email of the recipient.
              recipientEmail = emailDataTable.Rows[0]["delivery_email"].ToString();
          }
  
          public T[] EmailsData { get { return emailsData; } }
          public string RecipientEmail { get { return recipientEmail; } }
  
          private T[] emailsData;
          private string recipientEmail;
      }
  </code></pre>
  
  <p>If I decide to make a new instance of the Email class:</p>
  
  <pre><code>Email&lt;DeliveryEmailData&gt; email = new Email&lt;DeliveryEmailData&gt;(someDataTableObject);
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>'DeliveryEmailData' must be a non-abstract type with a public parameterless constructor in order to use it as parameter 'T'
  </code></pre>
  
  <p>When I add a parameterless constructor to both the base and derived classes, the error no longer shows up. The problem is that I don't need a parameterless constructor, but one that receives a DataTable object.</p>
  
  <p>So, does anyone know what is wrong with this?</p>