当我按流派和收视率要求标题时,我试图获取电影中的演员名单。
我用: 昏暗的catalogitem = (对于流派中的g 适用于g.titles 哪里t.genre =“西部片” 其中t.rating> = 4 选择t)。取(100)
这很有效,但我也想要这些电影的演员。如何更改此查询以包括返回演员?
非常感谢您的帮助。
由于
贝
答案 0 :(得分:0)
我知道您可以使用OData URI扩展强制转换:
http://odata.netflix.com/Catalog/Titles?$filter=Name%20eq%20'The%20Name%20of%20The%20Rose'&$expand=Cast&$format=json
从此页面: http://blogs.msdn.com/b/bethmassi/archive/2011/02/16/fun-with-odata-and-windows-phone-7.aspx
看起来您需要做的是在定义请求的URL时定义扩展:
Dim url = String.Format("/Genres('{0}')?$expand=Titles", Me.textBox1.Text)
Dim uri = New Uri(url, UriKind.Relative)
所以对你的情况: Dim url = String.Format(“/ Genres('{0}')?$ expand = Cast”,Me.textBox1.Text)
请注意,您还需要更改查询以请求演员:
from t in Titles select new {t, t.Cast}