Consuming OData services
This recipe demonstrates how to access OData using a simple URI. For this recipe, we will use the DataSvcUtil
to generate the proxy classes instead of adding a reference.
Getting ready
For this sample, we will be using an OData API exposed by Netflix, an online movie rental company. At the time of writing the book, this service was in preview mode; please refer to the online documentation for the latest changes:
Using your browser you can navigate to http://developer.netflix.com/docs/oData_Catalog to find all the documentation about the OData API.
You can browse OData using
http://odata.netflix.com/catalog/
. We will be using this link to consume the data in this recipe.There are several features available for us to consume the data. At the resource level, we can get Catalog Titles (Catalog/Titles), People (Catalog/People), Languages (Catalog/Languages), and Genres (Catalog/Genres).
We can use
$filter
to get the lowest rated titles available to watch instantly or the highest...