SlideShare a Scribd company logo
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

More Related Content

What's hot

jQuery basics for Beginners
jQuery basics for BeginnersjQuery basics for Beginners
jQuery basics for Beginners
Pooja Saxena
 
Mimsy XG Resource Session
Mimsy XG Resource SessionMimsy XG Resource Session
Mimsy XG Resource Session
Axiell ALM
 
Angular Data
Angular DataAngular Data
Angular Data
Stefan Unterhofer
 
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 || Salesforce
Amit Singh
 
List and images in html
List and images in htmlList and images in html
List and images in html
prithvisawla
 
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
jbersosa
 
04.Navigation on Windows Phone
04.Navigation on Windows Phone04.Navigation on Windows Phone
04.Navigation on Windows Phone
Nguyen 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 API
Sparkhound 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 Designing
Raja 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
 

What's hot (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
 

Similar to OData RESTful implementation

SAP ODATA Overview & Guidelines
SAP ODATA Overview & GuidelinesSAP ODATA Overview & Guidelines
SAP ODATA Overview & Guidelines
Ashish 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
 
Linked services
Linked servicesLinked services
Linked services
Carlos Pedrinaci
 
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 CloudStack
Chiradeep Vittal
 
Building RESTfull Data Services with WebAPI
Building RESTfull Data Services with WebAPIBuilding RESTfull Data Services with WebAPI
Building RESTfull Data Services with WebAPI
Gert 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 DynamoDB
Amazon Web Services
 
Rest introduction
Rest introductionRest introduction
Rest introduction
William Martinez Pomares
 
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 OData
Pace Integration
 
Session 29 - Servlets - Part 5
Session 29 - Servlets - Part 5Session 29 - Servlets - Part 5
Session 29 - Servlets - Part 5
PawanMM
 
Ruby On Rails Siddhesh
Ruby On Rails SiddheshRuby On Rails Siddhesh
Ruby On Rails Siddhesh
Siddhesh Bhobe
 
MeteorJS Introduction
MeteorJS IntroductionMeteorJS Introduction
MeteorJS Introduction
Nitya Narasimhan
 
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/Hibernate
Sunghyouk Bae
 

Similar to 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
 

Recently uploaded

原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
3ipehhoa
 
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
zoowe
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
3ipehhoa
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Brad Spiegel Macon GA
 
Comptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guideComptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guide
GTProductions1
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
Rogerio Filho
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
ufdana
 
Understanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdfUnderstanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdf
SEO Article Boost
 
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdfJAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
Javier Lasa
 
7 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 20247 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 2024
Danica Gill
 
Search Result Showing My Post is Now Buried
Search Result Showing My Post is Now BuriedSearch Result Showing My Post is Now Buried
Search Result Showing My Post is Now Buried
Trish Parr
 
Bài tập unit 1 English in the world.docx
Bài tập unit 1 English in the world.docxBài tập unit 1 English in the world.docx
Bài tập unit 1 English in the world.docx
nhiyenphan2005
 
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdfMeet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Florence Consulting
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
Arif0071
 
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
CIOWomenMagazine
 
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
vmemo1
 
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
cuobya
 
Italy Agriculture Equipment Market Outlook to 2027
Italy Agriculture Equipment Market Outlook to 2027Italy Agriculture Equipment Market Outlook to 2027
Italy Agriculture Equipment Market Outlook to 2027
harveenkaur52
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
3ipehhoa
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC
 

Recently uploaded (20)

原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
 
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
 
Comptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guideComptia N+ Standard Networking lesson guide
Comptia N+ Standard Networking lesson guide
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
 
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
一比一原版(CSU毕业证)加利福尼亚州立大学毕业证成绩单专业办理
 
Understanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdfUnderstanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdf
 
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdfJAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
 
7 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 20247 Best Cloud Hosting Services to Try Out in 2024
7 Best Cloud Hosting Services to Try Out in 2024
 
Search Result Showing My Post is Now Buried
Search Result Showing My Post is Now BuriedSearch Result Showing My Post is Now Buried
Search Result Showing My Post is Now Buried
 
Bài tập unit 1 English in the world.docx
Bài tập unit 1 English in the world.docxBài tập unit 1 English in the world.docx
Bài tập unit 1 English in the world.docx
 
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdfMeet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
 
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
 
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
 
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
 
Italy Agriculture Equipment Market Outlook to 2027
Italy Agriculture Equipment Market Outlook to 2027Italy Agriculture Equipment Market Outlook to 2027
Italy Agriculture Equipment Market Outlook to 2027
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
 

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