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
I was able to get my results using the LINQ:
from g in Genres
from t in g.Titles
where g.Name == "Horror"
select t
This way I don't need to use Expand. I can also use the URL: http://odata.netflix.com/Catalog/Genres('Horror')/Titles() to get the same results. This post by Chris Woodruff helped me understand the issue.
If you are receiving an DataServiceQueryException along with the message: Request version '1.0' is too low for the response. The lowest supported version is '2.0'.
You need to upgrade your version of .Net to .Net Framework 4 and download LINQPad for .NET Framework 4.0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With