title: Unable to cast object of type 'System.Single' to type 'System.Int32'
body: <p>I am confused by getting the following error:</p>
  
  <blockquote>
  <pre><code>Unable to cast object of type 'System.Single' to type 'System.Int32'.
  </code></pre>
  </blockquote>
  
  <p>I am fetching data and iterating them as follows:</p>
  
  <pre><code>public MyFault
  {
  
     public int fault_throw { get; set; }
  
  }
  
   protected List&lt;MyFault&gt; myfaults = new List&lt;MyFault&gt;();
   foreach (var package in packages2)
      {
         // the following line throws an error
        myfaults.Add(new MyFault {fault_throw=(int)(package["fault_throw"])});
      }
  </code></pre>