Search code examples
odata

How to answer OData sample questions


The below question is based in OData. The service root - https:IIODataDemo:80801MyService.svc

Customerlnvoices and Customers are two entity sets based on the CustomerInvoice and Customer entity types. enter image description here

It is a big help if anyone can provide answers to the questions below.

  1. Retrieve Customer No and Billing Address of the Customer Invoice where InvoiceId is 15104.

  2. Retrieve all the Customer Invoices ordered by Invoiceld (Ascending) and CustomerNo(Descending).

    1. Retrieve all Customers placed between 50th and 1ooth positions when ordered by Customer No in ascending order.

Thanks in advance.


Solution

    1. serviceroot/CustomerInvoice('15104')?$select=CustomerNo,BillingAddress
    2. serviceroot/CustomerInvoice?$orderby=InvoiceId asc, CustomerNo desc
    3. serviceroot/CustomerInvoice?@skip=49&$top=50&CustomerNo asc