Search code examples
c#.netsql-serverodata

oData Incorrect PageSize


I am trying to expose my tables through oData and I have a Pagesize of 100. I also have other query properties.

EnableQuery(PageSize = 100, MaxNodeCount = 1000, EnableConstantParameterization = true, HandleNullPropagation = HandleNullPropagationOption.Default, 
        MaxTop = 1000, MaxExpansionDepth = 1, MaxAnyAllExpressionDepth = 1)

However when I try to capture the query on the profiler surprisingly i see the page size as 101. I was expecting to see it as 100.

What am I missing here?

Cheers!


Solution

  • Take one more than page size as we need to know whether the collection was truncated or not while generating next page links. Check this and this code.

    It is by design.