Using Row_Number of SQL Server in Linq <p>I have a table with data like</p> <pre><code>Date Users ------------------ 01/03/2015 25 02/03/2015 28 04/03/2015 36 07/03/2015 45 08/03/2015 47 </code></pre> <p>I had created a table valued function in Sql Server using Row_Number which gave me output like below which I used for further processing</p> <pre><code>Date Users UsersAdded ---------------------------------- 01/03/2015 25 0 02/03/2015 28 3 04/03/2015 36 8 07/03/2015 45 9 08/03/2015 47 2 </code></pre> <p>However, I need to do the same thing in Linq now but it does not has the Row_Number function. I had a look at <a href="http://stackoverflow.com/questions/17788400/how-do-i-translate-a-query-that-uses-row-number-into-linq">How do I translate a query that uses ROW_NUMBER() into linq?</a> but that is not related to my query. </p> <p>My query in SQL had Rownum upon the date field and query was</p> <pre><code>select date, Users, (T1.Users - isnull(T2.Users,0)) as UsersAdded from tableuser T1 join tableuser T2 on T1.Rownum = (T2.RowNum +1) </code></pre> <p>I am new to LINQ so don't even know how to start on this query. Any help would be appreciated.</p>