title: List(T) from sql db table
body: <p>I want to create List(T) from sql db table</p>
  
  <p>let's say i have one table</p>
  
  <pre><code>ID    Name  
  1     xyz   
  2     efd
  3     abc
  4     pqr
  </code></pre>
  
  <p>i want to some code in C# who will read this db table data and write 
  following lines in my c# class or / notepad or whatever...</p>
  
  <pre><code>List&lt;ItemViewModel&gt; Items= new List&lt;ItemViewModel&gt;();
     Items.Add(new ItemViewModel() { id= 1, name= "xyz"}
     Items.Add(new ItemViewModel() { id= 2, name= "efd"}
     Items.Add(new ItemViewModel() { id= 3, name= "abc"}
     Items.Add(new ItemViewModel() { id= 4, name= "pqr"}
  </code></pre>
  
  <p>thanks in advance</p>