title: add a new column to list using linq and entity?
body: <p>I want to add a new column 'Id' to my list which I'm retrieving the data from database using Linq and entity framework, i have 12 rows and i need to add a new column 'Id' which should start from 1 to 12 based on the number of rows I'm getting from database the id should be incremented starting from 1</p>
  
  <p>this is my query</p>
  
  <pre><code>var Details = db.Details.Include(p =&gt; p.Name).Include(p =&gt; p.Gender);
  </code></pre>
  
  <p>the problem with this is that, I'm also implementing paging for my grid and when im clicking next page again the row numbers are being generated from sno 1, when my page 1 consists of records from row no 1 to 5, my page 2 row numbers should start from row no 6, but again my page 2 row numbers are starting from row no1..</p>
  
  <p>im posting my flow of fetching the data and binding the data to grid</p>
  
  <p>in the first step i have my model User.cs, which is interacting with database and fetching the data and storing the data in a <code>List&lt;&gt;</code></p>
  
  <p>in the next step, from my controller action method im invoking the method in my model User.cs which will fetch the data from the database and store it in the <code>List&lt;&gt;</code></p>
  
  <p>In the 3rd step, from my view im giving the source property of my webgrid to the list in my model which is holding the data</p>