Items count in OData v4 WebAPI response

前端 未结 4 1817
野性不改
野性不改 2021-02-14 03:47

How to return number of items in OData v4 HTTP response?

I need this number to pagination, so it should be number of items after filtering, but before \'skip\' and \'top

4条回答
  •  逝去的感伤
    2021-02-14 04:37

    Will you please take a look at the sample service TripPin web api implementation at https://github.com/OData/ODataSamples/blob/master/Scenarios/TripPin. You can follow the code in Airports controller and the service with the code http://services.odata.org/TripPinWebApiService/Airports?$count=true can return the count correctly.

提交回复
热议问题