WCF 数据服务还是其他什么?

发布于 2024-10-09 22:19:54 字数 162 浏览 0 评论 0原文

对于 WPF 客户端和 Sql Server 数据库应用程序,我计划使用 WCF 数据服务在客户端和数据库之间传递数据,但我发现 WCF 客户端的功能太有限。使用 JOINS 等的复杂 LINQ 查询无法发送到服务器。

我应该在这里使用另一种技术来支持从客户端到服务器的复杂 LINQ 查询吗?

For a WPF client and Sql Server database application, I plan to use WCF data services for passing data between client and the database but I find the WCF client too limited in its abilities. Complex LINQ queries with JOINS etc. cannot be sent over to the server.

Is there another techonology that I should use here which supports complex LINQ queries from client to the server?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

故人爱我别走 2024-10-16 22:19:54

无法使用 OData(又名 WCF 数据服务)连接数据并不完全正确。只是 LINQ to OData 不支持 join 语法。但是,您仍然可以使用 Expand 方法或简单地通过在 select 子句中指定关系来检索多个表的交集结果。例如,如果您有一个与 Phone 表有关系的 User 表,您可以编写“from u in ctx.User.Expand("Phone")...”,或者您可以编写“from u in ctx.User select new { u.Name, u.Phone }",它将检索电话集合。

我不知道有任何其他 RESTful LINQ 提供程序支持查询 SQL 数据。

It's not entirely correct that you can't join data using OData (a.k.a. WCF Data Services). It's just that LINQ to OData does not support join syntax. However you can still retrive results from intersection of multiple tables using either Expand method or simply by specifying a relationship in a select clause. For example, if you have a table User with relationship to Phone table, you can write "from u in ctx.User.Expand("Phone")...", or you can write "from u in ctx.User select new { u.Name, u.Phone }", and it will retrive Phone collection.

I am not aware of any other RESTful LINQ provider that would support querying SQL data.

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