Thursday, July 22, 2010

OData, REST and this cool program call LINQPad

I was watching this video http://azgroups.nextslide.com/odata-begins with Scott Hanselman about OData. OData is cool in itself, but what exited me most was then Scott showed this program call LINQPad http://www.LINQpad.net. LINQPad is not only a tool to build your LINQ statement in but also to execute against a data source. In Scott example, he use the http://odata.netflix.com/ as the data source and create a LINQ query that LINQPad then translator in to a REST statement, sooo cool :D

A simple walk through to query netflix.com

1) Open LINQPad and click on “Add connection”
clip_image002

2) Choose WCF Data Services as the data content and click next.
clip_image003

3) Insert the url to Netflix.com (http://odata.netflix.com/Catalog/) and click OK
clip_image004

4) Set the database to Netflix.com
clip_image006

5) Type a LINQ query like this
clip_image008

6) Select the SQL view instead of Results and wola your REST statement.
clip_image010

No comments:

Post a Comment