2

我有一个启用了 oData 的经典 REST Web api 控制器,它具有类似的 Get 功能

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

我需要了解如何拨打电话以仅使用某些 url 获取记录数

我试过了

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

但我明白了

消息:“不支持查询参数 '$count'。”

请注意,我使用的是返回 IQueryable 集合的 MongoDb。

4

1 回答 1

0

如果您只想获得计数,请尝试

http://localhost:9910/api/storeCommandsrest/$count
于 2015-05-25T06:57:43.193 回答