2

i have an oData enabled classic REST web api controller with a Get function like

[EnableQuery()]
    public IQueryable<StoreCommand> Get()
    {
        return _storeCommandService.GetAllStoreCommands().AsQueryable();
    }

i need to understand how i can make a call to get only the count of records using some url

i tried

http://localhost:9910/api/storeCommandsrest?$count

but i get

Message: "The query parameter '$count' is not supported."

please note that i am using MongoDb that is returning IQueryable of collection.

Raas Masood
  • 1,475
  • 3
  • 23
  • 61

1 Answers1

0

If you want to get only the count, try

http://localhost:9910/api/storeCommandsrest/$count
Yi Ding - MSFT
  • 2,864
  • 16
  • 16