Search code examples
countodata

Odata url not returning count


I am trying to check total records with a filter on a odata query. But it throws error

<m:message>Could not find a property named '$count' on type 'Edm.Boolean'.</m:message>

Any suggestions?

https://testodataurl.com/testService.svc/Entity?$filter=(Id eq 377 and MSF eq 'Good')/$count

Solution

  • $count is not a query option. It should appear before query options.

    So try

    https://testodataurl.com/testService.svc/Entity/$count/?$filter=(Id eq 377 and MSF eq 'Good')