Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
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
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
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.
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