2

I am using Odata runtime version v4.0.30319 and trying to get expanded items count in similar query

http://services.odata.org/OData/OData.svc/Categories?$select=Name,Products&$expand=Products

I am trying the below way. Do we have any option with odata to find out expanded items count?

http://services.odata.org/OData/OData.svc/Categories?$select=Name,Products($count=true)&$expand=Products
Kurkula
  • 6,386
  • 27
  • 127
  • 202

1 Answers1

3

The correct syntax should be :

http://services.odata.org/v4/OData/OData.svc/Categories?$select=Name&$expand=Products($count=true)

But it seems the demo service doesn't support it.

Karata
  • 1,079
  • 8
  • 16
  • This feature hasn't yet been implemented in the OData WebApi framework. http://stackoverflow.com/questions/28967908/odata-query-option-count-in-expand-not-working – Snæbjørn Oct 24 '15 at 11:58
  • This feature is working in the OData WebApi framework, but has not been enabled in the demo service as noted by @karata. Verified in Odata v4.0.30319 as requested! – Chris Schaller May 27 '19 at 02:26