ASP.net MVC 4 (web api) OData Configuration

前端 未结 4 1613
半阙折子戏
半阙折子戏 2021-01-12 17:23

Been playing around with the (Single Page App) BigShelf sample. I found really interesting is the GetBooksForSearch method (/api/BigShelf/GetBooksForSearch) that it takes ad

4条回答
  •  情深已故
    2021-01-12 17:41

    There's an action filter attribute called ResultLimitAttribute which you can use on any action method which returns IQueryable or even IEnumerable to limit the amount of data returned.

    [ResultLimit(100)]
    public IQueryable Get() {
        // ...
    }
    

提交回复
热议问题