Download presentation
Presentation is loading. Please wait.
1
OData everywhere Matt Milner Pluralsight
2
Overview What and why of OData OData client ecosystem
3
OData We need another data access technology? ODBCOLE DB ADO RDO ADO.NET Linq to SQL Entity Framework DataSet Which of these is cross platform?
4
Open Data Protocol Open : HTTP, ATOMPub, JSON Data : Querying & updating Protocol : Data format, uri constraints, metadata
5
Protocol GET http://localhost/TaskService.svc/Tasks Accept: application/json GET http://localhost/TaskService.svc/Tasks Accept: application/json HTTP/1.1 200 OK DataServiceVersion: 1.0; Content-Length: 876 Content-Type: application/json;charset=utf-8 {"d" : [ { "__metadata": { "uri": "http://localhost/TaskService.svc/Tasks(2)", "type": "TaskDBModel.Task" }, "TaskID": 2, "AssignedTo": "3", "DueDate": "\/Date(1298505600000)\/", "Description": "hire HR manager", "Priority": 1, "PercentComplete": 25 } ] } HTTP/1.1 200 OK DataServiceVersion: 1.0; Content-Length: 876 Content-Type: application/json;charset=utf-8 {"d" : [ { "__metadata": { "uri": "http://localhost/TaskService.svc/Tasks(2)", "type": "TaskDBModel.Task" }, "TaskID": 2, "AssignedTo": "3", "DueDate": "\/Date(1298505600000)\/", "Description": "hire HR manager", "Priority": 1, "PercentComplete": 25 } ] }
6
POST http://localhost/TaskService.svc/Tasks HTTP/1.1 Content-Type: application/json Accept: application/json Content-Length: 153 {"Description":“Fire Sally","Priority":1,"PercentComplete":25, "DueDate":"\/Date(1298505600000)\/","AssignedTo":"3"} POST http://localhost/TaskService.svc/Tasks HTTP/1.1 Content-Type: application/json Accept: application/json Content-Length: 153 {"Description":“Fire Sally","Priority":1,"PercentComplete":25, "DueDate":"\/Date(1298505600000)\/","AssignedTo":"3"} Protocol HTTP/1.1 201 Created DataServiceVersion: 1.0; Content-Length: 297 Location: http://localhost/TaskService.svc/Tasks(5) Content-Type: application/json;charset=utf-8 { "d" : { "__metadata": { "uri": "http://localhost/TaskService.svc/Tasks(5)", "type": "TaskDBModel.Task" }, "TaskID": 5, "AssignedTo": "3", "DueDate": "\/Date(1298505600000)\/", "Description": “Fire Sally", "Priority": 1, "PercentComplete": 25}} HTTP/1.1 201 Created DataServiceVersion: 1.0; Content-Length: 297 Location: http://localhost/TaskService.svc/Tasks(5) Content-Type: application/json;charset=utf-8 { "d" : { "__metadata": { "uri": "http://localhost/TaskService.svc/Tasks(5)", "type": "TaskDBModel.Task" }, "TaskID": 5, "AssignedTo": "3", "DueDate": "\/Date(1298505600000)\/", "Description": “Fire Sally", "Priority": 1, "PercentComplete": 25}}
7
System query options OptionDescriptionExample $filterFilters the result set/Movies?$filter=Title eq ‘Star Wars’ $orderbySort the target resources/Movies?$orderby=Title desc $topReturn only the top n resources/Movies?$top=10 /Movies?$orderby=Title&$top=5 $skipSkip the first n resources/Movies?$skip=100&$top=10 $selectCreate a projection/Movies(1)/’Reviews?$select=rating,review er $inlinecountIncludes the total count/Movies?$top=100&$inlinecount=allpages $valueRetrieve a value without any surrounding metadata /Movies(2)/Title/$value $expandEager loading of specified elements /Movies(1)?$expand=Reviews
8
OData producers Producers SharePoint 2010 SQL Azure Azure Table Storage IBM WebSphere Data Market... Services Ebay Facebook Netflix Pluralsight
9
OData clients Windows.NETSilverlightPowerPivot Browsers AtomJavaScriptjQuery Open Source PHPRubyJava Mobile Win Phone 7 IPhone / IPad (objective C) Android
10
Windows /.NET Add Service Reference Managed data context Full batching support Databinding
11
Silverlight DataServiceCollection – async load Out of browser support Browser or custom credentials (OOB)
12
PowerPivot Analytics Charting Relationships
13
Browsers JSON / ATOM JavaScript library
14
Open source Ruby = gem install ruby_odata Java = RestLet extension PHP = PHPDataSvcUtil
15
Phones Native libraries for Mac and WP7 Restlet / java support on Android
16
© 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.