I have an asp.net web api controller for which I have enabled odata query options. The controller is as follows:
[Queryable(PageSize = 10)]
public IQueryable<MyDTO> Get(string Id)
{
//some code here
}
As obvious from the Queryable
attribute, this controller always returns 10 records at a time if there are more than 10 MyDTO's
.
How can I find out which 10 records have been returned or which records have been filtered out by odata query option?
All pageSize does is do a
Take
on the queryable your action returned after the incoming $filter, $orderby, $skip, $top have been applied first. If you want to post-process the items that you return after the query is applied, you can takeODataQueryOptions<MyDTO>
as input and manually apply it on theIQueryable
Here are some samples.
http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/supporting-odata-query-options