title: Unable to cast object of type 'System.Collections.Generic.List`1[System.Decimal]' to type 'System.IConvertible'
body: <pre><code>var itemlist = (from u in db.getitems
                  select u).ToList();
  
  var item= new EstimatesModel
               {
                   id = Convert.ToInt64(estimatelist.id),
                   expiry_date = estimatelist.expiry_date,
                   terms_conditions = estimatelist.terms_conditions,
                   rate = Convert.ToDecimal(itemlist.Select(m =&gt;m.taxrate).ToList())
  
               };
  
  return View(item);
  </code></pre>
  
  <p>Here in this query note that rate has more than 1 items coming from <code>getitems</code> where <code>rate</code> is <code>Decimal</code> type , so I converted it.</p>
  
  <p>Then I am returning view on single entity <code>item</code> where only column <code>rate</code> is <code>List</code>.</p>
  
  <p>But I am getting this error while debugging-</p>
  
  <blockquote>
    <p>Unable to cast object of type 'System.Collections.Generic.List`1[System.Decimal]' to type 'System.IConvertible'.</p>
  </blockquote>
  
  <p>I will use this like this in view page-</p>
  
  <pre><code>@for (int i = 0; i &lt; Model.rate; i++)
  {
      &lt;ul&gt;
          &lt;li&gt;&lt;a href="#"&gt;@i&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
  }
  </code></pre>