寻呼与WCF数据服务 [英] Paging with WCF data service

查看:153
本文介绍了寻呼与WCF数据服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是关于你如何处理分页与WCF数据服务。我想用它的方式,是执行一个查询(传球页面大小和当前页面),并取回该查询,也像总页数,当前页码和页面大小寻呼信息的结果。该寻呼信息所使用的客户端(它是在转换结果的JSON消耗其移动应用程序的另一个服务)来处理一个/上一个按钮。

My question is about how you handle paging with a WCF data service. The way I want to use it, is execute a query (passing page size and current page), and get back the results of that query and also the paging information like total number of pages, current page number and page size. This paging information is used by the client (which is another service that transforms the result to JSON for a mobile application that consumes it) to handle next/previous buttons.

然而,在WCF数据服务使用LINQ太有限,它不支持LINQ表达我所需要的。

However, using LINQ on a WCF data service is too limited, it doesn't support the LINQ expression I need.

我试图在WCF 数据服务创建一个服务操作,但我只能返回数据实体的IQueryable的集合,所以我不能返回也包含寻呼信息的自定义实体。

I tried creating a service operation in the WCF data service, but I can only return IQueryable collections of data entities, so I cannot return a custom entity that also contains paging information.

有没有办法做到实现分页为WCF数据服务,使我旁边的结果,我也得回去寻呼信息?

Is there a way to do implement paging for a WCF data service so that I next to the result I also get back paging information?

编辑:由于WCF数据服务的局限性,我切换到一个正常的WCF服务。说实话,我不明白为什么有人会愿意使用这些严格的限制数据的服务!

because of the limitations of WCF data services, I switched to a normal WCF service. To be honest, I don't see why anyone would ever want to use a data service with these severe limitations!

推荐答案

不幸的是看来WCF数据服务是太有限,而对我来说,解决办法是切换到一个普通WCF服务,这样我可以使用完整的LINQ和定义数据契约自己。

Unfortunately it seems that WCF data services is way too limited, and the solution for me was to switch to a regular WCF service so that I could use full LINQ and define data contracts myself.

这篇关于寻呼与WCF数据服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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