Skip to content

Instantly share code, notes, and snippets.

@davidpadbury
Created January 13, 2011 03:11
Show Gist options
  • Save davidpadbury/777327 to your computer and use it in GitHub Desktop.
Save davidpadbury/777327 to your computer and use it in GitHub Desktop.
Querying NetFlix with a DataSvcUtil client
Gay
Golf
IMAX
Iran
LOGO
Math
Pets
Pop
Yoga
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ConsoleApplication1.Netflix;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
var netflix = new NetflixCatalog(new Uri("http://odata.netflix.com/v1/Catalog/"));
foreach (var genre in netflix.Genres.Where(s => s.Name.Length < 5))
{
Console.WriteLine(genre.Name);
}
}
}
}
GET http://odata.netflix.com/v1/Catalog/Genres()?$filter=length(Name)%20lt%205 HTTP/1.1
User-Agent: Microsoft ADO.NET Data Services
DataServiceVersion: 1.0;NetFx
MaxDataServiceVersion: 2.0;NetFx
Accept: application/atom+xml,application/xml
Accept-Charset: UTF-8
Host: odata.netflix.com
Connection: Keep-Alive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment