Which URL should you choose?

You create two custom lists named Offices and Rooms.

Rooms has the following columns:

* Title
* Capacity
* Equipment

Offices has the following columns:

* Title
* Rooms (a lookup to the Title column in the Rooms list)
* Rooms: Capacity
* Rooms: Equipment

You need to perform a Representational State Transfer (REST) query that returns a list of all the offices that have rooms with a capacity of 10. The query results must include the room titles and the equipment in each room.

Which URL should you choose?

You create two custom lists named Offices and Rooms.

Rooms has the following columns:

* Title
* Capacity
* Equipment

Offices has the following columns:

* Title
* Rooms (a lookup to the Title column in the Rooms list)
* Rooms: Capacity
* Rooms: Equipment

You need to perform a Representational State Transfer (REST) query that returns a list of all the offices that have rooms with a capacity of 10. The query results must include the room titles and the equipment in each room.

Which URL should you choose?

A.
/_vti_bin/ListData.svc/Offices $expand=Rooms&$filter=Rooms/Capacity eq 10

B.
/_vti_bin/ListData.svc/Offices &$filter=Rooms/Capacity eq 10

C.
/_vti_bin/ListData.svc/Rooms $expand=Offices&$filter=Rooms/Capacity eq 10

D.
/_vti_bin/ListData.svc/Rooms &$filter=Offices/Capacity eq 10

Explanation:
MNEMONIC RULE: “Offices – Rooms – Rooms/Capacity”

You can use the Expand method to navigate from one entity to a related entity.

You can append query strings to the URLs in order to specify filter criteria or query logic.

Using the REST Interface
http://msdn.microsoft.com/en-us/library/ff798339.aspx



Leave a Reply 0

Your email address will not be published. Required fields are marked *