OData的分页用的WebAPI($ inlinecount) [英] OData pagination with WebApi ( $inlinecount )

查看:1036
本文介绍了OData的分页用的WebAPI($ inlinecount)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从Web API调用返回。我可以通过与起始和结束索引的URL过滤数据。

I am using OData to paginate a long list of items returned from a web api call. I can filter the data via the url with the start and end index.

我的问题是,我怎么知道项目的总数是多少?因此,我可以这就要求网络API我的移动设备上显示的3(20个项目)1。

The question I have is, how do I know the total number of items? So I can display Page 1 of 3 (20 items) on my mobile device which calls the web api.

推荐答案

下面是一个工作版本的链接,它已经被实现为QueryableAttribute。
<一href=\"http://aspnetwebstack.$c$cplex.com/SourceControl/changeset/view/88372a0b4ab9#src%2fMicrosoft.Web.Http.Data%2fQueryFilterAttribute.cs\" rel=\"nofollow\">http://aspnetwebstack.$c$cplex.com/SourceControl/changeset/view/88372a0b4ab9#src%2fMicrosoft.Web.Http.Data%2fQueryFilterAttribute.cs

Here is a link to a working version, it have been implemented as a QueryableAttribute. http://aspnetwebstack.codeplex.com/SourceControl/changeset/view/88372a0b4ab9#src%2fMicrosoft.Web.Http.Data%2fQueryFilterAttribute.cs

编辑:
使用此链接进行了详细的解释 - >
<一href=\"http://www.strathweb.com/2012/08/supporting-odata-inlinecount-with-the-new-web-api-odata-$p$pview-package/\" rel=\"nofollow\">http://www.strathweb.com/2012/08/supporting-odata-inlinecount-with-the-new-web-api-odata-$p$pview-package/

这篇关于OData的分页用的WebAPI($ inlinecount)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆