ASP.net MVC 4 (web api) OData Configuration

前端 未结 4 1573
半阙折子戏
半阙折子戏 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:38

    It appears that the ResultLimitAttribute has been removed. See this commit

    It was rolled into a feature of the [Queryable] attribute which is now required for OData support. See discussion here

    Proper Usage would now be

    [Queryable(ResultLimit = 10)]

    [UPDATE]

    As of RTM the ResultLimit feature of Queryable has been removed. Also, [Queryable] has been moved to it's own preview package. See this blog post for more information and this post for instructions on the new usage.

    [UPDATE 2 11-16-12] With the ASP.Net Fall 2012 Update Preview things have been updated again. The ResultLimit Property of The [Queryable] attribute has been added back to the OData package.

    See article here for a run down of some of the changes.

    Here is the updated Nuget package. As of this writing it is a PREVIEW package.

提交回复
热议问题