当我按流派和收视率请求标题时,我正在尝试获取电影中的演员列表。
我使用:dim catalogitem = (For g in Genre For t in g.titles Where t.genre = "Westerns" Where t.rating >=4 select t).Take(100)
这很好用,但我也想要这些电影的演员。如何更改此查询以包括返回演员表?
非常感谢您的帮助。
谢谢
托尼
我知道您可以使用 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}