Guys,
Seems as if the query built by Entity spaces when Paging is being relied upon assumes that ROW_NUMBER() is zero based, whereas, according to the Transact-SQL reference, it is 1- based:
Returns the sequential number of a row within a partition of a result set, starting at 1 for the first row in each partition.
See an example es.LastQuery taken from a debugging session: The first load asks for rows 0 thru 14 for when PageNumber is 0 and PageSize is 15:
LastQuery = "WITH [withStatement] AS (SELECT *, ROW_NUMBER() OVER( ORDER BY [Name] ASC) AS ESRN FROM [Golf].[dbo].[Union]) SELECT * FROM [withStatement] WHERE ESRN BETWEEN 0 AND 14"
Am I correct in pointing this out as a possible problem?
Regards
Leon