title: How to add object from a class to List in another class.
body: <p>I am not sure I am asking this question properly and have had trouble searching for what I need in this case. I have two classes. One consists of three items that I will assign.</p>
  
  <pre><code>namespace Common.PriceFeed
  {
      public class SurchargeSKUList
      {
          public string WebSKUID { get; set; }
          public decimal AdditionalPrice { get; set; }
          public string Currency { get; set; }
      }
  }
  </code></pre>
  
  <p>The other class is a list containing the items from the above class. </p>
  
  <pre><code>namespace Common.PriceFeed
  {
      public class BaseSurcharge
      {
          public List&lt;SurchargeSKUList&gt; SKUList { get; set; }
      }
  }
  </code></pre>
  
  <p>My problem is, then I try to use BaseSurcharge, I get errors like I am using as type as a variable or that I "cannot implicitly convert type..."
  My .net code is below. </p>
  
  <p>Thank you. </p>
  
  <pre><code>if (BaseSurcharges.Rows.Count &gt; 0)
  {
      foreach (DataRow row in BaseSurcharges.Rows)
      {
          SurchargeSKUList newSKUList = new SurchargeSKUList();
          newSKUList.WebSKUID = row["WebSKUID"].ToString();
          newSKUList.AdditionalPrice = Convert.ToDecimal(row["AdditionalPrice"]);
          newSKUList.Currency = row["Currency"].ToString();
  
          BaseSurcharge newSurcharge = new BaseSurcharge();
          newSurcharge.SKUList = List&lt;SurchargeSKUList&gt;newSKUList;
  
          //BaseSurcharge List&lt;SurchargeSKUList&gt; newSurcharge = new BaseSurcharge
          //BaseSurcharge newSurcharge = new BaseSurcharge();
          //newSurcharge.SKUList = newSKUList;
              }
          }
  </code></pre>