SlideShare une entreprise Scribd logo
1  sur  24
Télécharger pour lire hors ligne
Designing OData Services
with ASP.NET Web API
Gabriel ENEA
Technical Lead @
@dotnet18 / gabrielenea.blogspot.com
20 April 2013
Our world is
awash in data
BUSINESS AND FINANCE
HEALTH AND WELLNESS
AUTOMOTIVE, INDUSTRIAL, &
AEROSPACE
GOVERNMENT
SPORTS AND GAMES
WORLDWIDE HISTORICAL
WEATHER DATA
The Data has value only if it can be used
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
Demo 1
• Using OData with Excel
How OData works?
OData
Client Library
OData Service
OData
Data Model
OData
Protocol
Client
Data Source
HTTP,
REST,
JSON/Atom
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
OData Formats
• Atom Pub (XML)
• JSON “light” (introduced in OData v3)
• JSON “verbose” (OData v2)
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.
OData features in ASP.NET Web API
• Queries
• CRUD operations
• Entity Relations
• Actions
• Handling errors
• OData compliant errors
• Handling Unmapped Requests
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)"}
Demo 2+
• Formats
• Queries
• CRUD operations
• Entity Relations
• Actions
• Handling errors
OData Security Guidance
• EDM Security
• [IgnoreDataMember] attribute
• Query Security
OData features coming later to
ASP.NET Web API
• $expand
• $select
• Batch updates
• Media streams (picture, media files)
Consuming OData Services
• Your Browser (e.g. OData Explorer)
• .NET: WCF Data Services
• Java: odata4j (including Java on Android)
• JavaScript: JQuery, JayData, datajs, Breeze
• PHP: OData SDK for PHP
• Fiddler, LinqPad
Resources
www.odata.org
www.asp.net/web-api
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

Contenu connexe

Similaire à Iasi code camp 20 april 2013 gabriel enea - designing o-data services with asp.net web api

Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)Igor Moochnick
 
OData for iOS developers
OData for iOS developersOData for iOS developers
OData for iOS developersGlen Gordon
 
Building RESTful Applications with OData
Building RESTful Applications with ODataBuilding RESTful Applications with OData
Building RESTful Applications with ODataTodd Anglin
 
Apache Olingo - ApacheCon Denver 2014
Apache Olingo - ApacheCon Denver 2014Apache Olingo - ApacheCon Denver 2014
Apache Olingo - ApacheCon Denver 2014Stephan Klevenz
 
Building IoT and Big Data Solutions on Azure
Building IoT and Big Data Solutions on AzureBuilding IoT and Big Data Solutions on Azure
Building IoT and Big Data Solutions on AzureIdo Flatow
 
Document_format_for_OData_In_A_Nutshell.pdf
Document_format_for_OData_In_A_Nutshell.pdfDocument_format_for_OData_In_A_Nutshell.pdf
Document_format_for_OData_In_A_Nutshell.pdfdavidjpeace
 
Develop iOS and Android apps with SharePoint/Office 365
Develop iOS and Android apps with SharePoint/Office 365Develop iOS and Android apps with SharePoint/Office 365
Develop iOS and Android apps with SharePoint/Office 365Kashif Imran
 
Myth Busters II: BI Tools and Data Virtualization are Interchangeable
Myth Busters II: BI Tools and Data Virtualization are InterchangeableMyth Busters II: BI Tools and Data Virtualization are Interchangeable
Myth Busters II: BI Tools and Data Virtualization are InterchangeableDenodo
 
Building nTier Applications with Entity Framework Services (Part 2)
Building nTier Applications with Entity Framework Services (Part 2)Building nTier Applications with Entity Framework Services (Part 2)
Building nTier Applications with Entity Framework Services (Part 2)David McCarter
 
SQL Server Data Services
SQL Server Data ServicesSQL Server Data Services
SQL Server Data ServicesEduardo Castro
 
Sharepoint Server 2010 Genel Bilgilendirme
Sharepoint Server 2010 Genel BilgilendirmeSharepoint Server 2010 Genel Bilgilendirme
Sharepoint Server 2010 Genel BilgilendirmeEvren Ayan
 
Gaining the Knowledge of the Open Data Protocol (OData)
Gaining the Knowledge of the Open Data Protocol (OData)Gaining the Knowledge of the Open Data Protocol (OData)
Gaining the Knowledge of the Open Data Protocol (OData)Woodruff Solutions LLC
 
Linked Data Spaces, Data Portability & Access
Linked Data Spaces, Data Portability & AccessLinked Data Spaces, Data Portability & Access
Linked Data Spaces, Data Portability & AccessKingsley Uyi Idehen
 
Gaining the Knowledge of the Open Data Protocol (OData)
Gaining the Knowledge of the Open Data Protocol (OData)Gaining the Knowledge of the Open Data Protocol (OData)
Gaining the Knowledge of the Open Data Protocol (OData)Woodruff Solutions LLC
 
Building nTier Applications with Entity Framework Services (Part 2)
Building nTier Applications with Entity Framework Services (Part 2)Building nTier Applications with Entity Framework Services (Part 2)
Building nTier Applications with Entity Framework Services (Part 2)David McCarter
 

Similaire à Iasi code camp 20 april 2013 gabriel enea - designing o-data services with asp.net web api (20)

Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)
 
OData for iOS developers
OData for iOS developersOData for iOS developers
OData for iOS developers
 
Breaking down data silos with OData
Breaking down data silos with ODataBreaking down data silos with OData
Breaking down data silos with OData
 
Real-Time Web Applications with ASP.NET WebAPI and SignalR
Real-Time Web Applications with ASP.NET WebAPI and SignalRReal-Time Web Applications with ASP.NET WebAPI and SignalR
Real-Time Web Applications with ASP.NET WebAPI and SignalR
 
Building RESTful Applications with OData
Building RESTful Applications with ODataBuilding RESTful Applications with OData
Building RESTful Applications with OData
 
Apache Olingo - ApacheCon Denver 2014
Apache Olingo - ApacheCon Denver 2014Apache Olingo - ApacheCon Denver 2014
Apache Olingo - ApacheCon Denver 2014
 
Building IoT and Big Data Solutions on Azure
Building IoT and Big Data Solutions on AzureBuilding IoT and Big Data Solutions on Azure
Building IoT and Big Data Solutions on Azure
 
Document_format_for_OData_In_A_Nutshell.pdf
Document_format_for_OData_In_A_Nutshell.pdfDocument_format_for_OData_In_A_Nutshell.pdf
Document_format_for_OData_In_A_Nutshell.pdf
 
Develop iOS and Android apps with SharePoint/Office 365
Develop iOS and Android apps with SharePoint/Office 365Develop iOS and Android apps with SharePoint/Office 365
Develop iOS and Android apps with SharePoint/Office 365
 
Myth Busters II: BI Tools and Data Virtualization are Interchangeable
Myth Busters II: BI Tools and Data Virtualization are InterchangeableMyth Busters II: BI Tools and Data Virtualization are Interchangeable
Myth Busters II: BI Tools and Data Virtualization are Interchangeable
 
Building nTier Applications with Entity Framework Services (Part 2)
Building nTier Applications with Entity Framework Services (Part 2)Building nTier Applications with Entity Framework Services (Part 2)
Building nTier Applications with Entity Framework Services (Part 2)
 
SQL Server Data Services
SQL Server Data ServicesSQL Server Data Services
SQL Server Data Services
 
W8/WP8 App Dev for SAP, Part 2: Microsoft OData Application Development
W8/WP8 App Dev for SAP, Part 2: Microsoft OData Application DevelopmentW8/WP8 App Dev for SAP, Part 2: Microsoft OData Application Development
W8/WP8 App Dev for SAP, Part 2: Microsoft OData Application Development
 
Sharepoint Server 2010 Genel Bilgilendirme
Sharepoint Server 2010 Genel BilgilendirmeSharepoint Server 2010 Genel Bilgilendirme
Sharepoint Server 2010 Genel Bilgilendirme
 
Gaining the Knowledge of the Open Data Protocol (OData)
Gaining the Knowledge of the Open Data Protocol (OData)Gaining the Knowledge of the Open Data Protocol (OData)
Gaining the Knowledge of the Open Data Protocol (OData)
 
Linked Data Spaces, Data Portability & Access
Linked Data Spaces, Data Portability & AccessLinked Data Spaces, Data Portability & Access
Linked Data Spaces, Data Portability & Access
 
Microsoft & IoT
Microsoft & IoTMicrosoft & IoT
Microsoft & IoT
 
Gaining the Knowledge of the Open Data Protocol (OData)
Gaining the Knowledge of the Open Data Protocol (OData)Gaining the Knowledge of the Open Data Protocol (OData)
Gaining the Knowledge of the Open Data Protocol (OData)
 
Building nTier Applications with Entity Framework Services (Part 2)
Building nTier Applications with Entity Framework Services (Part 2)Building nTier Applications with Entity Framework Services (Part 2)
Building nTier Applications with Entity Framework Services (Part 2)
 
Access any data anywhere
Access any data anywhereAccess any data anywhere
Access any data anywhere
 

Plus de Codecamp Romania

Cezar chitac the edge of experience
Cezar chitac   the edge of experienceCezar chitac   the edge of experience
Cezar chitac the edge of experienceCodecamp Romania
 
Business analysis techniques exercise your 6-pack
Business analysis techniques   exercise your 6-packBusiness analysis techniques   exercise your 6-pack
Business analysis techniques exercise your 6-packCodecamp Romania
 
Bpm company code camp - configuration or coding with pega
Bpm company   code camp - configuration or coding with pegaBpm company   code camp - configuration or coding with pega
Bpm company code camp - configuration or coding with pegaCodecamp Romania
 
Andrei prisacaru takingtheunitteststothedatabase
Andrei prisacaru takingtheunitteststothedatabaseAndrei prisacaru takingtheunitteststothedatabase
Andrei prisacaru takingtheunitteststothedatabaseCodecamp Romania
 
2015 dan ardelean develop for windows 10
2015 dan ardelean   develop for windows 10 2015 dan ardelean   develop for windows 10
2015 dan ardelean develop for windows 10 Codecamp Romania
 
The case for continuous delivery
The case for continuous deliveryThe case for continuous delivery
The case for continuous deliveryCodecamp Romania
 
Stefan stolniceanu spritekit, 2 d or not 2d
Stefan stolniceanu   spritekit, 2 d or not 2dStefan stolniceanu   spritekit, 2 d or not 2d
Stefan stolniceanu spritekit, 2 d or not 2dCodecamp Romania
 
Sizing epics tales from an agile kingdom
Sizing epics   tales from an agile kingdomSizing epics   tales from an agile kingdom
Sizing epics tales from an agile kingdomCodecamp Romania
 
Raluca butnaru corina cilibiu the unknown universe of a product and the cer...
Raluca butnaru corina cilibiu   the unknown universe of a product and the cer...Raluca butnaru corina cilibiu   the unknown universe of a product and the cer...
Raluca butnaru corina cilibiu the unknown universe of a product and the cer...Codecamp Romania
 
Parallel & async processing using tpl dataflow
Parallel & async processing using tpl dataflowParallel & async processing using tpl dataflow
Parallel & async processing using tpl dataflowCodecamp Romania
 
Material design screen transitions in android
Material design screen transitions in androidMaterial design screen transitions in android
Material design screen transitions in androidCodecamp Romania
 
Kickstart your own freelancing career
Kickstart your own freelancing careerKickstart your own freelancing career
Kickstart your own freelancing careerCodecamp Romania
 
Ionut grecu the soft stuff is the hard stuff. the agile soft skills toolkit
Ionut grecu   the soft stuff is the hard stuff. the agile soft skills toolkitIonut grecu   the soft stuff is the hard stuff. the agile soft skills toolkit
Ionut grecu the soft stuff is the hard stuff. the agile soft skills toolkitCodecamp Romania
 
Diana antohi me against myself or how to fail and move forward
Diana antohi   me against myself  or how to fail  and move forwardDiana antohi   me against myself  or how to fail  and move forward
Diana antohi me against myself or how to fail and move forwardCodecamp Romania
 

Plus de Codecamp Romania (20)

Cezar chitac the edge of experience
Cezar chitac   the edge of experienceCezar chitac   the edge of experience
Cezar chitac the edge of experience
 
Cloud powered search
Cloud powered searchCloud powered search
Cloud powered search
 
Ccp
CcpCcp
Ccp
 
Business analysis techniques exercise your 6-pack
Business analysis techniques   exercise your 6-packBusiness analysis techniques   exercise your 6-pack
Business analysis techniques exercise your 6-pack
 
Bpm company code camp - configuration or coding with pega
Bpm company   code camp - configuration or coding with pegaBpm company   code camp - configuration or coding with pega
Bpm company code camp - configuration or coding with pega
 
Andrei prisacaru takingtheunitteststothedatabase
Andrei prisacaru takingtheunitteststothedatabaseAndrei prisacaru takingtheunitteststothedatabase
Andrei prisacaru takingtheunitteststothedatabase
 
Agility and life
Agility and lifeAgility and life
Agility and life
 
2015 dan ardelean develop for windows 10
2015 dan ardelean   develop for windows 10 2015 dan ardelean   develop for windows 10
2015 dan ardelean develop for windows 10
 
The bigrewrite
The bigrewriteThe bigrewrite
The bigrewrite
 
The case for continuous delivery
The case for continuous deliveryThe case for continuous delivery
The case for continuous delivery
 
Stefan stolniceanu spritekit, 2 d or not 2d
Stefan stolniceanu   spritekit, 2 d or not 2dStefan stolniceanu   spritekit, 2 d or not 2d
Stefan stolniceanu spritekit, 2 d or not 2d
 
Sizing epics tales from an agile kingdom
Sizing epics   tales from an agile kingdomSizing epics   tales from an agile kingdom
Sizing epics tales from an agile kingdom
 
Scale net apps in aws
Scale net apps in awsScale net apps in aws
Scale net apps in aws
 
Raluca butnaru corina cilibiu the unknown universe of a product and the cer...
Raluca butnaru corina cilibiu   the unknown universe of a product and the cer...Raluca butnaru corina cilibiu   the unknown universe of a product and the cer...
Raluca butnaru corina cilibiu the unknown universe of a product and the cer...
 
Parallel & async processing using tpl dataflow
Parallel & async processing using tpl dataflowParallel & async processing using tpl dataflow
Parallel & async processing using tpl dataflow
 
Material design screen transitions in android
Material design screen transitions in androidMaterial design screen transitions in android
Material design screen transitions in android
 
Kickstart your own freelancing career
Kickstart your own freelancing careerKickstart your own freelancing career
Kickstart your own freelancing career
 
Ionut grecu the soft stuff is the hard stuff. the agile soft skills toolkit
Ionut grecu   the soft stuff is the hard stuff. the agile soft skills toolkitIonut grecu   the soft stuff is the hard stuff. the agile soft skills toolkit
Ionut grecu the soft stuff is the hard stuff. the agile soft skills toolkit
 
Ecma6 in the wild
Ecma6 in the wildEcma6 in the wild
Ecma6 in the wild
 
Diana antohi me against myself or how to fail and move forward
Diana antohi   me against myself  or how to fail  and move forwardDiana antohi   me against myself  or how to fail  and move forward
Diana antohi me against myself or how to fail and move forward
 

Iasi code camp 20 april 2013 gabriel enea - designing o-data services with asp.net web api

  • 1. Designing OData Services with ASP.NET Web API Gabriel ENEA Technical Lead @ @dotnet18 / gabrielenea.blogspot.com 20 April 2013
  • 9.
  • 10. The Data has value only if it can be used
  • 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
  • 12. Demo 1 • Using OData with Excel
  • 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)"}
  • 19. Demo 2+ • Formats • Queries • CRUD operations • Entity Relations • Actions • Handling errors
  • 20. OData Security Guidance • EDM Security • [IgnoreDataMember] attribute • Query Security
  • 21. OData features coming later to ASP.NET Web API • $expand • $select • Batch updates • Media streams (picture, media files)
  • 22. Consuming OData Services • Your Browser (e.g. OData Explorer) • .NET: WCF Data Services • Java: odata4j (including Java on Android) • JavaScript: JQuery, JayData, datajs, Breeze • PHP: OData SDK for PHP • Fiddler, LinqPad
  • 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