title: Adding in IList using for Loop
body: <p>I'm have list of result as </p>
  
  <pre><code>var attributeresult= " some list of items......";
  </code></pre>
  
  <p>Now I'm trying to loop form result and adding into IList.but I'm getting only lastly inserting values,but I want to get all the values.</p>
  
  <pre><code> IList&lt;DynamicColumn&gt; idynamicttableColumns = new List&lt;DynamicColumn&gt;();
   DynamicColumn dynamictableColumns = new DynamicColumn();
  
  
   for (int i = 0; i &lt; attributeresult.Count(); i++)
                          {
                              dynamictableColumns.Name = attributeresult.ElementAt(i).AttributeName;
                              dynamictableColumns.Type = attributeresult.ElementAt(i).AttributeSqlType;
                              dynamictableColumns.IsNullable = false;
                              idynamicttableColumns.Add(dynamictableColumns);
  
                          }
  </code></pre>
  
  <p>I have to accomplish with for loop only not with for each loop.</p>