SlideShare ist ein Scribd-Unternehmen logo
1 von 26
REST WEB SERVICES
» SOAP (Service Oriented) and REST (Resource Oriented)
» REpresentational State Transfer
» REST Principles: Client-Server, Stateless, Cacheable, Layered
system, Code on demand, Uniform Interface, Identification of
resources, Manipulation of resources, self-descriptive messages
» REST API is an architecture that adheres to the above principles.
» Simple words: JSON interaction with a client application. Content negotiation
made clearer using REST.
» ODATA is a protocol. It solves specific problem faced in REST API design.
ODATA KEY FEATURES OVER WEB API
• Query able and Interoperable RESTful API
• Containment of Dependent Objects (Child Objects)
• Deferred Execution
• Easy Query Conventions
• Powerful data reading capability
ODATA REST IMPLEMENTATION EXAMPLE
I will be showing an example where I implemented an OData Service. I will
be
focussing mainly on the HTTP GET of the ODATA.
The next following pages will be:
• Tables used for this example
• OData REST page using swagger integration.
• Queries used with example
• Project Settings
TABLES USED
MY ODATA REST SERVICE PAGE
$SELECT
$TOP
$SKIP
$EXPAND
$expand Query: Posts($select=Title;$expand=TypeOfPosts($select=Type))
Post (Child entity of Blog) & TypeOfPost (Child entity of Post)
Note: Refer table diagram in Slide 5 for tables’ relationship. Response Body is shown partially below.
$COUNT
$ORDERBY
$FILTER
This particular query can be used in various combinations.
• Comparative $filter - contains, eq – equal, ne- not equals, lt – less than,
gt – greater than, le – less than and equals, ge- greater than and equals
• Nested $filter - $filter used against other query options. (e.g. $expand
with $filter)
• Conditional $filter - and, or, not
• Lambda/anonymous $filter – any, all
• Arithmetic $filter - Add – addition , mul – multiplication , div – division ,
sub – subtraction .
NOTE: Arithmetic and Conditional $filter will not have my project example
as they do not relate to my sample ODATA project. I have provided
another suitable example.
COMPARATIVE $FILTER
Reverse lookup example: contains(Name,
‘sel’)
Another example: Name eq ‘Russell Watson’
NESTED $FILTER CONDITIONAL $FILTER
Example: $filter = (Section eq ‘IT’) and not (SubjectCode eq
‘10026’)
LAMBDA $FILTER
Another example: Posts/any(vr:vr/Title eq ‘IOO1’)
Example: $filter = AmountOfCash div NumberOfRecords gt 10
ARITHMETIC $Filter
CREATE DEFAULT MVC WEB API
ADD NEW CONTROLLER FOR ODATA
CREATE DATA MODELS
DB CONTEXT
MODIFY ODATA CONTROLLER
NOTE: By default, Odata Controller’s Enable Query retrieves inline entities up to 2
levels. More than 2 levels need to be mentioned explicitly by Max Expansion
Depth.
ODATA CONFIG
SWAGGER CONFIG (OPTIONAL)
NOTE: This setting will be needed if you want to test this in swagger tool.
WEB API CONFIG
GLOBAL ASAX
SUMMARY
By the end of this presentation, I hope you can make use of ODATA in a RESTful
manner. OData has been for many years and has been overly underrated.
With this presentation, we have covered:
• REST service
• Highlights of ODATA
• ODATA Implementation
• ODATA Query options
• ODATA Project setup
Please have a read through in the blog for OData for more information.
https://www.odata.org/
THANK YOU

Weitere ähnliche Inhalte

Was ist angesagt?

jQuery basics for Beginners
jQuery basics for BeginnersjQuery basics for Beginners
jQuery basics for BeginnersPooja Saxena
 
Mimsy XG Resource Session
Mimsy XG Resource SessionMimsy XG Resource Session
Mimsy XG Resource SessionAxiell ALM
 
Introduction to Jquery
Introduction to Jquery Introduction to Jquery
Introduction to Jquery Tajendar Arora
 
Ransack ruby on rails - HuanND
Ransack ruby on rails - HuanNDRansack ruby on rails - HuanND
Ransack ruby on rails - HuanNDFramgia Vietnam
 
SOQL in salesforce || Salesforce Object Query Language || Salesforce
SOQL in salesforce || Salesforce Object Query Language || SalesforceSOQL in salesforce || Salesforce Object Query Language || Salesforce
SOQL in salesforce || Salesforce Object Query Language || SalesforceAmit Singh
 
List and images in html
List and images in htmlList and images in html
List and images in htmlprithvisawla
 
Modulo para conectar un programa en vb 6
Modulo para conectar un programa en vb 6Modulo para conectar un programa en vb 6
Modulo para conectar un programa en vb 6jbersosa
 
04.Navigation on Windows Phone
04.Navigation on Windows Phone04.Navigation on Windows Phone
04.Navigation on Windows PhoneNguyen Tuan
 
Introduction to the SharePoint 2013 REST API
Introduction to the SharePoint 2013 REST APIIntroduction to the SharePoint 2013 REST API
Introduction to the SharePoint 2013 REST APISparkhound Inc.
 
Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010Rob Windsor
 
Mule soft RAML API Designing
Mule soft RAML API DesigningMule soft RAML API Designing
Mule soft RAML API DesigningRaja Reddy
 
jQuery
jQueryjQuery
jQueryi.omar
 
ADL/U-SQL Introduction (SQLBits 2016)
ADL/U-SQL Introduction (SQLBits 2016)ADL/U-SQL Introduction (SQLBits 2016)
ADL/U-SQL Introduction (SQLBits 2016)Michael Rys
 
OData and SharePoint
OData and SharePointOData and SharePoint
OData and SharePointSanjay Patel
 
SharePoint 2010 Client-side Object Model
SharePoint 2010 Client-side Object ModelSharePoint 2010 Client-side Object Model
SharePoint 2010 Client-side Object ModelPhil Wicklund
 

Was ist angesagt? (19)

jQuery basics for Beginners
jQuery basics for BeginnersjQuery basics for Beginners
jQuery basics for Beginners
 
Mimsy XG Resource Session
Mimsy XG Resource SessionMimsy XG Resource Session
Mimsy XG Resource Session
 
Angular Data
Angular DataAngular Data
Angular Data
 
Introduction to Jquery
Introduction to Jquery Introduction to Jquery
Introduction to Jquery
 
Ransack ruby on rails - HuanND
Ransack ruby on rails - HuanNDRansack ruby on rails - HuanND
Ransack ruby on rails - HuanND
 
SOQL in salesforce || Salesforce Object Query Language || Salesforce
SOQL in salesforce || Salesforce Object Query Language || SalesforceSOQL in salesforce || Salesforce Object Query Language || Salesforce
SOQL in salesforce || Salesforce Object Query Language || Salesforce
 
List and images in html
List and images in htmlList and images in html
List and images in html
 
Modulo para conectar un programa en vb 6
Modulo para conectar un programa en vb 6Modulo para conectar un programa en vb 6
Modulo para conectar un programa en vb 6
 
04.Navigation on Windows Phone
04.Navigation on Windows Phone04.Navigation on Windows Phone
04.Navigation on Windows Phone
 
Chapter 15
Chapter 15Chapter 15
Chapter 15
 
Routes Controllers
Routes ControllersRoutes Controllers
Routes Controllers
 
Introduction to the SharePoint 2013 REST API
Introduction to the SharePoint 2013 REST APIIntroduction to the SharePoint 2013 REST API
Introduction to the SharePoint 2013 REST API
 
Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010
 
Mule soft RAML API Designing
Mule soft RAML API DesigningMule soft RAML API Designing
Mule soft RAML API Designing
 
jQuery
jQueryjQuery
jQuery
 
ADL/U-SQL Introduction (SQLBits 2016)
ADL/U-SQL Introduction (SQLBits 2016)ADL/U-SQL Introduction (SQLBits 2016)
ADL/U-SQL Introduction (SQLBits 2016)
 
JSON and XML
JSON and XMLJSON and XML
JSON and XML
 
OData and SharePoint
OData and SharePointOData and SharePoint
OData and SharePoint
 
SharePoint 2010 Client-side Object Model
SharePoint 2010 Client-side Object ModelSharePoint 2010 Client-side Object Model
SharePoint 2010 Client-side Object Model
 

Ähnlich wie OData RESTful implementation

SAP ODATA Overview & Guidelines
SAP ODATA Overview & GuidelinesSAP ODATA Overview & Guidelines
SAP ODATA Overview & GuidelinesAshish Saxena
 
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)Pat Patterson
 
JAVA EE DEVELOPMENT (JSP and Servlets)
JAVA EE DEVELOPMENT (JSP and Servlets)JAVA EE DEVELOPMENT (JSP and Servlets)
JAVA EE DEVELOPMENT (JSP and Servlets)Talha Ocakçı
 
Learning How to Shape and Configure an OData Feed for High Performing Web Sit...
Learning How to Shape and Configure an OData Feed for High Performing Web Sit...Learning How to Shape and Configure an OData Feed for High Performing Web Sit...
Learning How to Shape and Configure an OData Feed for High Performing Web Sit...Woodruff Solutions LLC
 
Java Web services
Java Web servicesJava Web services
Java Web servicesSujit Kumar
 
StackMate - CloudFormation for CloudStack
StackMate - CloudFormation for CloudStackStackMate - CloudFormation for CloudStack
StackMate - CloudFormation for CloudStackChiradeep Vittal
 
Building RESTfull Data Services with WebAPI
Building RESTfull Data Services with WebAPIBuilding RESTfull Data Services with WebAPI
Building RESTfull Data Services with WebAPIGert Drapers
 
Rails Request & Middlewares
Rails Request & MiddlewaresRails Request & Middlewares
Rails Request & MiddlewaresSantosh Wadghule
 
AWS Webcast - Build high-scale applications with Amazon DynamoDB
AWS Webcast - Build high-scale applications with Amazon DynamoDBAWS Webcast - Build high-scale applications with Amazon DynamoDB
AWS Webcast - Build high-scale applications with Amazon DynamoDBAmazon Web Services
 
An Introduction to Tornado
An Introduction to TornadoAn Introduction to Tornado
An Introduction to TornadoGavin Roy
 
MuleSoft London Community February 2020 - MuleSoft and OData
MuleSoft London Community February 2020 - MuleSoft and ODataMuleSoft London Community February 2020 - MuleSoft and OData
MuleSoft London Community February 2020 - MuleSoft and ODataPace Integration
 
Session 29 - Servlets - Part 5
Session 29 - Servlets - Part 5Session 29 - Servlets - Part 5
Session 29 - Servlets - Part 5PawanMM
 
Ruby On Rails Siddhesh
Ruby On Rails SiddheshRuby On Rails Siddhesh
Ruby On Rails SiddheshSiddhesh Bhobe
 
Learning How to Shape and Configure an OData Service for High Performing Web ...
Learning How to Shape and Configure an OData Service for High Performing Web ...Learning How to Shape and Configure an OData Service for High Performing Web ...
Learning How to Shape and Configure an OData Service for High Performing Web ...Woodruff Solutions LLC
 
Alternatives of JPA/Hibernate
Alternatives of JPA/HibernateAlternatives of JPA/Hibernate
Alternatives of JPA/HibernateSunghyouk Bae
 

Ähnlich wie OData RESTful implementation (20)

SAP ODATA Overview & Guidelines
SAP ODATA Overview & GuidelinesSAP ODATA Overview & Guidelines
SAP ODATA Overview & Guidelines
 
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
OData: Universal Data Solvent or Clunky Enterprise Goo? (GlueCon 2015)
 
Linked services
Linked servicesLinked services
Linked services
 
JAVA EE DEVELOPMENT (JSP and Servlets)
JAVA EE DEVELOPMENT (JSP and Servlets)JAVA EE DEVELOPMENT (JSP and Servlets)
JAVA EE DEVELOPMENT (JSP and Servlets)
 
Learning How to Shape and Configure an OData Feed for High Performing Web Sit...
Learning How to Shape and Configure an OData Feed for High Performing Web Sit...Learning How to Shape and Configure an OData Feed for High Performing Web Sit...
Learning How to Shape and Configure an OData Feed for High Performing Web Sit...
 
Java Web services
Java Web servicesJava Web services
Java Web services
 
StackMate - CloudFormation for CloudStack
StackMate - CloudFormation for CloudStackStackMate - CloudFormation for CloudStack
StackMate - CloudFormation for CloudStack
 
Building RESTfull Data Services with WebAPI
Building RESTfull Data Services with WebAPIBuilding RESTfull Data Services with WebAPI
Building RESTfull Data Services with WebAPI
 
Rails Request & Middlewares
Rails Request & MiddlewaresRails Request & Middlewares
Rails Request & Middlewares
 
AWS Webcast - Build high-scale applications with Amazon DynamoDB
AWS Webcast - Build high-scale applications with Amazon DynamoDBAWS Webcast - Build high-scale applications with Amazon DynamoDB
AWS Webcast - Build high-scale applications with Amazon DynamoDB
 
Rest introduction
Rest introductionRest introduction
Rest introduction
 
Ntg web services
Ntg   web servicesNtg   web services
Ntg web services
 
An Introduction to Tornado
An Introduction to TornadoAn Introduction to Tornado
An Introduction to Tornado
 
MuleSoft London Community February 2020 - MuleSoft and OData
MuleSoft London Community February 2020 - MuleSoft and ODataMuleSoft London Community February 2020 - MuleSoft and OData
MuleSoft London Community February 2020 - MuleSoft and OData
 
Web Services
Web ServicesWeb Services
Web Services
 
Session 29 - Servlets - Part 5
Session 29 - Servlets - Part 5Session 29 - Servlets - Part 5
Session 29 - Servlets - Part 5
 
Ruby On Rails Siddhesh
Ruby On Rails SiddheshRuby On Rails Siddhesh
Ruby On Rails Siddhesh
 
MeteorJS Introduction
MeteorJS IntroductionMeteorJS Introduction
MeteorJS Introduction
 
Learning How to Shape and Configure an OData Service for High Performing Web ...
Learning How to Shape and Configure an OData Service for High Performing Web ...Learning How to Shape and Configure an OData Service for High Performing Web ...
Learning How to Shape and Configure an OData Service for High Performing Web ...
 
Alternatives of JPA/Hibernate
Alternatives of JPA/HibernateAlternatives of JPA/Hibernate
Alternatives of JPA/Hibernate
 

Kürzlich hochgeladen

『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书rnrncn29
 
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一Fs
 
Q4-1-Illustrating-Hypothesis-Testing.pptx
Q4-1-Illustrating-Hypothesis-Testing.pptxQ4-1-Illustrating-Hypothesis-Testing.pptx
Q4-1-Illustrating-Hypothesis-Testing.pptxeditsforyah
 
Magic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMagic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMartaLoveguard
 
Elevate Your Business with Our IT Expertise in New Orleans
Elevate Your Business with Our IT Expertise in New OrleansElevate Your Business with Our IT Expertise in New Orleans
Elevate Your Business with Our IT Expertise in New Orleanscorenetworkseo
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书rnrncn29
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)Christopher H Felton
 
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Sonam Pathan
 
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一Fs
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一z xss
 
NSX-T and Service Interfaces presentation
NSX-T and Service Interfaces presentationNSX-T and Service Interfaces presentation
NSX-T and Service Interfaces presentationMarko4394
 
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作ys8omjxb
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITMgdsc13
 
PHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationPHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationLinaWolf1
 
SCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is prediSCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is predieusebiomeyer
 
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Excelmac1
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Paul Calvano
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa494f574xmv
 

Kürzlich hochgeladen (20)

『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
 
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
 
Q4-1-Illustrating-Hypothesis-Testing.pptx
Q4-1-Illustrating-Hypothesis-Testing.pptxQ4-1-Illustrating-Hypothesis-Testing.pptx
Q4-1-Illustrating-Hypothesis-Testing.pptx
 
Magic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMagic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptx
 
Elevate Your Business with Our IT Expertise in New Orleans
Elevate Your Business with Our IT Expertise in New OrleansElevate Your Business with Our IT Expertise in New Orleans
Elevate Your Business with Our IT Expertise in New Orleans
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
 
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
 
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
 
Hot Sexy call girls in Rk Puram 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in  Rk Puram 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in  Rk Puram 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Rk Puram 🔝 9953056974 🔝 Delhi escort Service
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
 
NSX-T and Service Interfaces presentation
NSX-T and Service Interfaces presentationNSX-T and Service Interfaces presentation
NSX-T and Service Interfaces presentation
 
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITM
 
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
young call girls in Uttam Nagar🔝 9953056974 🔝 Delhi escort Service
 
PHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 DocumentationPHP-based rendering of TYPO3 Documentation
PHP-based rendering of TYPO3 Documentation
 
SCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is prediSCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is predi
 
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa
 

OData RESTful implementation

  • 1.
  • 2. REST WEB SERVICES » SOAP (Service Oriented) and REST (Resource Oriented) » REpresentational State Transfer » REST Principles: Client-Server, Stateless, Cacheable, Layered system, Code on demand, Uniform Interface, Identification of resources, Manipulation of resources, self-descriptive messages » REST API is an architecture that adheres to the above principles. » Simple words: JSON interaction with a client application. Content negotiation made clearer using REST. » ODATA is a protocol. It solves specific problem faced in REST API design.
  • 3. ODATA KEY FEATURES OVER WEB API • Query able and Interoperable RESTful API • Containment of Dependent Objects (Child Objects) • Deferred Execution • Easy Query Conventions • Powerful data reading capability
  • 4. ODATA REST IMPLEMENTATION EXAMPLE I will be showing an example where I implemented an OData Service. I will be focussing mainly on the HTTP GET of the ODATA. The next following pages will be: • Tables used for this example • OData REST page using swagger integration. • Queries used with example • Project Settings
  • 6. MY ODATA REST SERVICE PAGE
  • 10. $EXPAND $expand Query: Posts($select=Title;$expand=TypeOfPosts($select=Type)) Post (Child entity of Blog) & TypeOfPost (Child entity of Post) Note: Refer table diagram in Slide 5 for tables’ relationship. Response Body is shown partially below.
  • 13. $FILTER This particular query can be used in various combinations. • Comparative $filter - contains, eq – equal, ne- not equals, lt – less than, gt – greater than, le – less than and equals, ge- greater than and equals • Nested $filter - $filter used against other query options. (e.g. $expand with $filter) • Conditional $filter - and, or, not • Lambda/anonymous $filter – any, all • Arithmetic $filter - Add – addition , mul – multiplication , div – division , sub – subtraction . NOTE: Arithmetic and Conditional $filter will not have my project example as they do not relate to my sample ODATA project. I have provided another suitable example.
  • 14. COMPARATIVE $FILTER Reverse lookup example: contains(Name, ‘sel’) Another example: Name eq ‘Russell Watson’ NESTED $FILTER CONDITIONAL $FILTER Example: $filter = (Section eq ‘IT’) and not (SubjectCode eq ‘10026’)
  • 15. LAMBDA $FILTER Another example: Posts/any(vr:vr/Title eq ‘IOO1’) Example: $filter = AmountOfCash div NumberOfRecords gt 10 ARITHMETIC $Filter
  • 16.
  • 18. ADD NEW CONTROLLER FOR ODATA
  • 21. MODIFY ODATA CONTROLLER NOTE: By default, Odata Controller’s Enable Query retrieves inline entities up to 2 levels. More than 2 levels need to be mentioned explicitly by Max Expansion Depth.
  • 23. SWAGGER CONFIG (OPTIONAL) NOTE: This setting will be needed if you want to test this in swagger tool.
  • 26. SUMMARY By the end of this presentation, I hope you can make use of ODATA in a RESTful manner. OData has been for many years and has been overly underrated. With this presentation, we have covered: • REST service • Highlights of ODATA • ODATA Implementation • ODATA Query options • ODATA Project setup Please have a read through in the blog for OData for more information. https://www.odata.org/ THANK YOU