如何编写基于ria服务的求和计算?
当对 SL 应用程序使用 ria 服务时,我可以发出以下异步调用来获取一组实体列表。
LoadOperation<Person> ch =
this.AMSContext.Load(this.AMSContext.GetPersonQuery().Where(a => a.PersonID == this.performer.PersonID));
但我想得到一些计算,例如 sum(Commission)、sum(Salary),结果不是实体,只是一个标量值。我该怎么做?
When using ria service for SL app, I can issue following async call to get a group of entity list.
LoadOperation<Person> ch =
this.AMSContext.Load(this.AMSContext.GetPersonQuery().Where(a => a.PersonID == this.performer.PersonID));
But I want to get some calculation, for example, sum(Commission), sum(Salary), the result is not entity, just a scalar value. How can I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用通过WCF 方法返回任何值的方法。
在服务器端,您将拥有类似这样的内容
,您可以像这样从客户端访问它:
检查 这个问题了解更多详细信息。
You could use methods that return any values with WCF methods.
On the server side you will have something like this
And you can access it from the client like this :
Check this question for more details.