RIA 服务 - 过滤是在服务器还是客户端完成?

发布于 2024-09-16 10:54:09 字数 409 浏览 1 评论 0原文

假设我有一些如下代码:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

反差帅 2024-09-23 10:54:10

任何指定为提供给 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文