WebApi
WebApi copied to clipboard
ODataQueryOptions forces materialization of the IQueryable when PageSize is set
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