Use LINQ to query nested OData collection

Posted by Kyle Russell on Stack Overflow See other posts from Stack Overflow or by Kyle Russell
Published on 2010-04-20T23:50:04Z Indexed on 2010/04/20 23:53 UTC
Read the original article Hit count: 1388

Filed under:
|
|

I'm playing around with the new Netflix OData feed (http://odata.netflix.com/Catalog/) and having some issues. I'm trying to learn LINQ at the same time but having difficulty doing what I thought was going to be quite simple.

I'd like to return a list of Titles that match a given Genre. The Titles object contains a collection of Genres. I'm not sure how to write this query. My attempt below does not appear to work using LINQPad.

from t in Titles
where t.Genres.Name.Contains("ABC")
select t

© Stack Overflow or respective owner

Related posts about LINQ

Related posts about OData