RIA 服务 - 过滤是在服务器还是客户端完成?
假设我有一些如下代码:
ExampleDomainContext ctx = new ExampleDomainContext();
var query = from p in ctx.GetPeopleQuery()
where p.Id > 2
select p;
ctx.Load<Person>(query).Completed += (s, e) =>
{
// do some stuff
};
这是在客户端上完成的,并且来自 RIA 服务的 GetPeopleQuery() 调用返回人员表中的所有人员。
我的问题是查询(ID > 2 的人)是否被转换到服务器并运行,或者服务器是否将所有人返回给客户端然后进行过滤?
Lets say I have some code like:
ExampleDomainContext ctx = new ExampleDomainContext();
var query = from p in ctx.GetPeopleQuery()
where p.Id > 2
select p;
ctx.Load<Person>(query).Completed += (s, e) =>
{
// do some stuff
};
This is being done on the client, and the GetPeopleQuery() call from the RIA service returns all people from the people table.
My question is whether the query (people whose Id > 2) is getting translated to the server and run or does the server return all people to the client and then do the filtering?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
任何指定为提供给 Load() 方法的 EntityQuery 一部分的过滤器都将在服务器上执行。如果需要,您可以在客户端进一步查询查询结果。
Any filters specified as part of the EntityQuery given to the Load() method will be performed on the server. You can further query the results of queries on the client if needed.