WebApi icon indicating copy to clipboard operation
WebApi copied to clipboard

ODataQueryOptions forces materialization of the IQueryable when PageSize is set

Open kosinsky opened this issue 8 years ago • 2 comments

ODataQueryOptions Apply methods accepts IQueryable and returns IQueryable, however when PageSize is specified LimitResult is called that uses TruncatedCollection that is List<T> that forces materialization and blocks post processing of the IQueryable for example to implement $skiptoken or do query checks/optimizations.

If we try to workaround it by not setting PageSize and doing Take manually after, stable sorting will not be applied that changes behavior.

Assemblies affected

*All version of WAO

Expected result

IQueryable with Take(PageSize) returned

Actual result

List returned

kosinsky avatar Jan 09 '17 22:01 kosinsky