Changes

Jump to: navigation, search

Odata Overview

6 bytes added, 14:12, 10 May 2018
Syntax of OData Queries
==Syntax of OData Queries==
# 1. Service Metadata Document - describes the data model exposed as HTTP endpoints by the service.
<pre>http://mysmartsimpleurl/OData/V4/pub/424623/Service.svc/$metadata</pre>
# 2. Search syntax i.e. criteria on report using “???”: the URL below returns OData records with firstname equal ‘steve’ only
<pre>http://mysmartsimpleurl/OData/V4/pub/424623/Service.svc/report_Neo_records?$search=steve</pre>
# 3. Filter for dynamical search: the URL below returns OData records with firstname equal ‘steve’ only (eq stands for equal in OData protocol)
<pre>http://mysmartsimpleurl/OData/V4/pub/424623/Service.svc/report_Neo_records?$filter=first_name +eq+steve </pre>
# 4. Ordering: the URL below orders by first name
<pre>http://mysmartsimpleurl/OData/V4/pub/424623/Service.svc/report_Neo_records?$orderby=first_name+asc
</pre>
# 5. $top and $skip, used mainly for pagination: The syntax below skips 3 records and return 2 records only (i.e. only 4th and 5th will return)
<pre> http://mysmartsimpleurl/OData/V4/pub/424623/Service.svc/report_Neo_records?$top=2&$skip=3</pre>
# 6. $count, used to determine how many rows in a collection
<pre> http://mysmartsimpleurl/OData/V4/pub/424623/Service.svc/report_Neo_records/$count</pre>
Smartstaff
1,385
edits

Navigation menu