Use the indexed overload of Select:
var start = page * rowsPerPage;
Products.OrderByDescending(u => u.Sales.Count())
.Skip(start)
.Take(rowsPerPage)
.AsEnumerable()
.Select((u, index) => new { Product = u, Index = index + start });
More Related Contents:
- thread messaging system database schema design
- How to click in imagelink in gridview and go to another gridview
- MVC3 and Entity Framework
- ASP.NET Identity DbContext confusion
- How can I force entity framework to insert identity columns?
- How to “warm-up” Entity Framework? When does it get “cold”?
- How and where to call Database.EnsureCreated and Database.Migrate?
- The result of a query cannot be enumerated more than once
- Entity Framework: how to solve “FOREIGN KEY constraint may cause cycles or multiple cascade paths”?
- How to warm up an ASP.NET MVC application on IIS 7.5?
- “The LINQ expression node type ‘Invoke’ is not supported in LINQ to Entities” – stumped!
- The type initializer for ‘System.Data.Entity.Internal.AppConfig’ threw an exception
- It has a DefiningQuery but no InsertFunction element… err
- Linq Orderby random ThreadSafe for use in ASP.NET
- Entity Framework 4 – Update database schema from model. Without wiping the table data
- Entity framework context as static
- Unable to Retrieve Metadata
- Difference between DropDownlist or DropDownListFor Html helper
- Unit-testing .ToListAsync() using an in-memory
- Unable to create an object of type ‘[DBContext’s Name]’. For the different patterns supported at design time [closed]
- Entity Framework v2 doesn’t support sql 2000?
- LINQ to SQL Web Application Best Practices
- Can some hacker steal a web browser cookie from a user and login with that name on a web site?
- Is trying to develop for Medium Trust a lost cause?
- jqGrid: using multiple methods to filter data
- Does ASP.NET Web Forms prevent a double click submission?
- Elmah not working with asp.net site
- How to access your website through LAN in ASP.NET [closed]
- ASP.NET Image uploading with Resizing
- Is there an #IF DEBUG for Asp.net markup?