Collection of Entity References Context URL template: {context-url}#Collection($ref) If a response is a collection of entity references, the context URL does not contain the type of the referenced entities. Example 23: resource URL and corresponding context URL for a collection of entity references http://host/service/Customers('ALFKI')/Orders/$ref http://host/service/$metadata#Collection($ref) Entity Reference Context URL template: {context-url}#$ref If a response is a single entity reference, $ref is the context URL fragment. Example 24: resource URL and corresponding context URL for a single entity reference http://host/service/Orders(10643)/Customer/$ref http://host/service/$metadata#$ref Property Value Context URL templates: {context-url}#{entity}/{property-path}{select-list} {context-url}#{type-name}{select-list} If a response represents an of an entity with a canonical URL, the context URL specifies the canonical URL of the entity and the path to the structural property of that entity. The path MUST include cast segments for properties defined on types derived from the expected type of the previous segment. If the property value does not contain explicitly or implicitly selected navigation properties or operations, OData 4.01 responses MAY use the less specific second template. Example 25: resource URL and corresponding context URL http://host/service/Customers(1)/Addresses http://host/service/$metadata#Customers(1)/Addresses Collection of Complex or Primitive Context URL template: {context-url}#Collection({type-name}){select-list} If a response is a collection of complex types or primitive types that do not represent an individual property of an entity with a canonical URL, the context URL specifies the fully qualified type of the collection. Example 26: resource URL and corresponding context URL http://host/service/TopFiveHobbies() http://host/service/$metadata#Collection(Edm.String)
Collection of Entity References Context URL template: {context-url}#Collection($ref) If a response is a collection of entity references, the context URL does not contain the type of the referenced entities. Example 23: resource URL and corresponding context URL for a collection of entity references http://host/service/Customers('ALFKI')/Orders/$ref http://host/service/$metadata#Collection($ref) Entity Reference Context URL template: {context-url}#$ref If a response is a single entity reference, $ref is the context URL fragment. Example 24: resource URL and corresponding context URL for a single entity reference http://host/service/Orders(10643)/Customer/$ref http://host/service/$metadata#$ref Property Value Context URL templates: {context-url}#{entity}/{property-path}{select-list} {context-url}#{type-name}{select-list} If a response represents an of an entity with a canonical URL, the context URL specifies the canonical URL of the entity and the path to the structural property of that entity. The path MUST include cast segments for properties defined on types derived from the expected type of the previous segment. If the property value does not contain explicitly or implicitly selected navigation properties or operations, OData 4.01 responses MAY use the less specific second template. Example 25: resource URL and corresponding context URL http://host/service/Customers(1)/Addresses http://host/service/$metadata#Customers(1)/Addresses Collection of Complex or Primitive Context URL template: {context-url}#Collection({type-name}){select-list} If a response is a collection of complex types or primitive types that do not represent an individual property of an entity with a canonical URL, the context URL specifies the fully qualified type of the collection. Example 26: resource URL and corresponding context URL http://host/service/TopFiveHobbies() http://host/service/$metadata#Collection(Edm.String)
odata-v4.01-cs01-part1-protocol.docx