title: Unable to cast object of type 'InternationalRowViewDetailsModel' to type 'System.Collections.IEnumerator'
body: <p>I have a class as follows:</p>
  
  <pre><code>using System;
  using System.Collections;
  using System.Collections.Generic;
  
  namespace DataBinding.Schemas.Scenario.ViewModels
  {
      public class InternationalRowViewDetailsModel: IEnumerable
      {
          public InternationalRowViewDetailsModel()
          {
              Country = new System.Collections.Generic.Dictionary&lt;object, object&gt;();
              RateEUR = new System.Collections.Generic.Dictionary&lt;object, object&gt;();
              RateGBP = new System.Collections.Generic.Dictionary&lt;object, object&gt;();
              RateUSD = new System.Collections.Generic.Dictionary&lt;object, object&gt;();
          }
  
          public Dictionary&lt;object, object&gt; Country { get; set; }
          public Dictionary&lt;object, object&gt; RateEUR { get; set; }
          public Dictionary&lt;object, object&gt; RateGBP { get; set; }
          public Dictionary&lt;object, object&gt; RateUSD { get; set; }
  
          public IEnumerator GetEnumerator() { return (IEnumerator)this; }
      }
  }
  </code></pre>
  
  <p>Now I am trying to iterate through the values of InternationalRowViewDetailsModel as follows:</p>
  
  <pre><code>foreach (InternationalRowViewDetailsModel currentRow in viewModel)
  {
     Row newRow = FillInternationalNumberRow(itemRow, currentRow);
     tableNode.Rows.Add(newRow);
  }
  </code></pre>
  
  <p>I want to use foreach and send each current row to the method FillInternationalNumberRow which fills in columns of a table.</p>
  
  <pre><code> private static Row FillInternationalNumberRow(Row rowTemplate, InternationalRowViewDetailsModel internationalViewModel)
          {
              Row newRow = rowTemplate.Clone(true) as Row;
              int currentCell = 0;
              if (newRow != null)
              {
                  newRow.Cells[currentCell++].FirstParagraph.Runs[0].Text = internationalViewModel.Country.ToString();
                  newRow.Cells[currentCell++].FirstParagraph.Runs[0].Text = internationalViewModel.RateEUR.ToString();
                  newRow.Cells[currentCell++].FirstParagraph.Runs[0].Text = internationalViewModel.RateGBP.ToString();
                  newRow.Cells[currentCell++].FirstParagraph.Runs[0].Text = internationalViewModel.RateUSD.ToString();
              }
              return newRow;
          }
  </code></pre>
  
  <p>But I get the following error:
  Unable to cast object of type 'DataBinding.Schemas.Scenario.ViewModels.InternationalRowViewDetailsModel' to type 'System.Collections.IEnumerator'</p>