score:2

Accepted answer

The right way to do this is, first get rid of the join and use Navigation properties, then the right order is IQueryable.OrderBy.[ThenBy.]Skip.Take.Select. And you must provide an OrderBy that completely orders the results, or else your pages can have gaps and overlaps.

List<ContractTableRow> rows =
       db.Contracts
         .OrderBy( r => r.Id )
         .Skip(page * size)
         .Take(size)
         .Select( c => new ContractTableRow()
           {
              c.Id,
              c.Worker.Name...
           })
         .ToList();

Related Articles