Use LINQ to query a collection of nested OData

I play with the new Netflix OData feed ( http://odata.netflix.com/Catalog/ ) and some problems. I am trying to learn LINQ at the same time, but having difficulty doing what I thought would be fairly simple.

I would like to return a list of names that correspond to this genre. The Titles object contains a collection of genres. I am not sure how to write this request. My attempt below does not work using LINQPad .

from t in Titles
where t.Genres.Name.Contains("ABC")
select t
+5
source share
3 answers

I managed to get the results using LINQ:

from g in Genres
from t in g.Titles
where g.Name == "Horror"
select t

, Expand. URL-: http://odata.netflix.com/Catalog/Genres ('Horror')/Titles() . post .

+7

DataServiceQueryException : " 1.0" . - "2.0".

.Net .Net Framework 4 LINQPad .NET Framework 4.0

+1

,

(from g in Genres.Expand("Titles")
where g.Name == "Horror"
select g).Dump();

URL- LinqPad

/Catalog/Genres('Horror')?$expand=Titles

, .Expand . netflix odata , URL-: http://netflix.cloudapp.net/Catalog/Genres (' ')/

.Expand

0
source

All Articles