11. What is the Open Data Protocol?
Web
Browsers
Mobile
Phones
BI tools
Custom
applications
(.NET, Java,
PHP)
Clients
OData
Custom
applications
(.NET, Java,
PHP)
Cloud Storage
(Windows
Azure Tables,
SQL Azure)
Content
Management
(SharePoint)
Windows
Azure Data
Marketplace
Data Sources
13. How OData works?
OData
Client Library
OData Service
OData
Data Model
OData
Protocol
Client
Data Source
HTTP,
REST,
JSON/Atom
14. Entity Container
Entity SetEntity Set
Entity
OData Entity Data Model
Property
Navigation
Property
Entity
Property
Navigation
Property
Entity
Property
Navigation
Property
Entity
Property Property
Entity
Property Property
Association
Association
GET http://www.fabrikam.com/odata/$metadata
15. OData Formats
• Atom Pub (XML)
• JSON “light” (introduced in OData v3)
• JSON “verbose” (OData v2)
16. OData Query Options
Option Description
$filter Filters the results, based on a Boolean
condition.
$inlinecount Tells the server to include the total count of
matching entities in the response. (Useful for
server-side paging.)
$orderby Sorts the results.
$skip Skips the first n results.
$top Returns only the first n the results.
17. OData features in ASP.NET Web API
• Queries
• CRUD operations
• Entity Relations
• Actions
• Handling errors
• OData compliant errors
• Handling Unmapped Requests
18. OData Entity Relations / Links
• Edit relationships between two entities
• Each link has a URI with the form:
entity/$links/entity
• e.g.:
/Jobs(1)/$links/Company
POST http://localhost/odata/jobs(1)/$links/Company
Content-Type: application/json
Content-Length: 50
{"url":"http://localhost/odata/companies(‘Maxcode)"}
24. Designing OData Services with ASP.NET Web API
Gabriel ENEA
Technical Lead – Maxcode
@dotnet18 / gabrielenea.blogspot.com
20 April 2013
Please fill in your evaluation form