WCF数据服务联接查询 [英] WCF Data Services join query

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

问题描述

我想检索此查询的结果(罗斯文数据库):

I want to retrieve the results of this query (Northwind Database):

var ent = new Entities();

var query = from c in ent.Customers
    join o in ent.Orders on c.CustomerID equals o.CustomerID
    join od in ent.Order_Details on o.OrderID equals od.OrderID
    join p in ent.Products on od.ProductID equals p.ProductID
    where p.ProductName == "Chai"
    select c;

通过使用WCF数据服务.我输入这个(不起作用):

by using WCF Data Services. I type this (which doesn't work):

http://localhost:29792/WcfDataService1.svc/Customers?$select=CompanyName&$expand=Orders/Order_Details/Products?$filter='Name' eq 'Chai'

我应该如何正确输入?

推荐答案

虽然不支持 Join ,但导航属性/关联是受支持的,您也可以使用 .Expand().因此,尽管您无法从 .Join 获取它,但是有多种方法来获取所需的数据.

Although Join isn't supported, navigation properties/associations are, and you can also use .Expand(). So although you can't get it from .Join, there are multiple ways to get the data you need.

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

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