OData pagination with WebApi ( $inlinecount )

前端 未结 3 1985
情话喂你
情话喂你 2021-01-02 06:58

I am using OData to paginate a long list of items returned from a web api call. I can filter the data via the url with the start and end index.

The question I have i

3条回答
  •  爱一瞬间的悲伤
    2021-01-02 07:11

    You can use $inlinecount=allpages in the query to get the count of all the entities in the results without the top and skip. For example:

    http://services.odata.org/OData/OData.svc/Products?$top=1&skip=1&$inlinecount=allpages

    Returns a single product but also inline count of 9 (since there are 9 products in the entity set).

提交回复
热议问题