2.2.6.2.6 Deferred Content

The serialized representation of an entity and its related entities, identified by NavigationProperties, can be large. For resource conservation purposes (bandwidth, CPU, and so on), a data service generally does not want to return the full graph of entities related to the EntityType instance or set identified in a request URI. For example, a data service ought to defer sending entities represented by any navigation property in a response unless explicitly asked to send those entities via the $expand system query option, as described in Expand System Query Option ($expand) (section 2.2.3.6.1.3).

Entity Type (as an Atom Entry Element) (section 2.2.6.2.2) specifies Atom-formatted EntityType instances which MUST contain atom:link elements for each NavigationProperty on the EntityType. When these atom:link elements are empty, they signify deferred NavigationProperty content (for example, the entities represented by the NavigationProperty are not serialized inline). For example, using the two EntityTypes Customer and Order, as specified in Appendix A: Sample Entity Data Model and CSDL Document (section 6), the default Atom serialization of the Customer instance with EntityKey value of "ALFKI" is shown with deferred NavigationProperty content in the Atom-formatted Customer entity listing in Entity Type (as an Atom Entry Element) (section 2.2.6.2.2).

In the example, the presence of the empty atom:link element with rel attribute whose value is http://schemas.microsoft.com/ado/2007/08/dataservices/related/Orders signifies that the value of the Order's NavigationProperty is deferred (this is not directly represented in this serialization). In order to retrieve the deferred value(s), a client can make a separate request to the navigation property URIservice.svc/Customers('ALFKI')/Orders or explicitly ask that the property be loaded inline via the $expand system query option, as described in Expand System Query Option ($expand) (section 2.2.3.6.1.3).