title: foreach statement cannot operate on variables of type Dars does not contain a public definition for 'GetEnumerator'
body: <p>I have a list Dars</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  
  namespace PantaRei.Components
  {
      public class Dars
      {
          public float OpBal      { get; set; }
          public float PlNeOrRec  { get; set; }
          public float MiCaCol    { get; set; }
          public float MiDeCol    { get; set; }
          public float MiWrOff    { get; set; }
          public float ClBal      { get; set; }
  
          public float Tot
          {
              get { return OpBal+ PlNeOrRec+ MiCaCol + MiDeCol + MiWrOff; }
          }
      }
  }
  </code></pre>
  
  <p>I create a new dars </p>
  
  <pre><code>Dars secA1 = new Dars();
  </code></pre>
  
  <p>And Then I use this bit of code to fill it up</p>
  
  <pre><code>public static void GetData(ref Dars secA1, Ddr ddr, Ddrs ddrs, Type pTypes)
      {
          Array typesEnum = Enum.GetValues(pTypes);
  
          foreach (Enum types in typesEnum)
          {
              string pType = StringEnum.GetStringValue(types);
  
              secA1.OpBal = ddrs.Out.Sum(o =&gt; o.Amount);
  
              secA1.MiDeCol += ddr.Dil.Where(dil =&gt; dil.ProductType == pType &amp;&amp; dil.ToBeSold).Sum(dil =&gt; dil.Amount);
  
              secA1.PlNeOrRec += ddr.Rec.Where(rec =&gt; rec.ToBeSold).Sum(rec =&gt; rec.Amount);
  
              GetMiCaCol(ref secA1, ddr, pType);
              GetMiWrOff(ref secA1, ddr, pType);
          }
      }
  </code></pre>
  
  <p>Now I would like to do something like this</p>
  
  <pre><code>int i = 11;
              foreach (float g in secA1)
              {
                  daily.Cells[i, 4] = g;
                  i++;
              }
  </code></pre>
  
  <p>But I'm getting this error</p>
  
  <blockquote>
    <p>foreach statement cannot operate on variables of type 'PantaRei.Components.Dars' because 'PantaRei.Components.Dars' does not contain a public definition for 'GetEnumerator'</p>
  </blockquote>
  
  <p>How do I solve this?</p>