简体   繁体   中英

get count from oData enabled web api Get function

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.

如果只想计数 ,请尝试

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM