Currently if we want to retrieve the references to the individual entities instead of inlining the entities themselves the $expand syntax allows us to append /$ref to the navigation property that represents that collection of entities. If we wanted the size of that collection, after optionally applying any filters that might have been specified for such collection, one would need to add the $inlinecount ($count if ODATA-339 gets accepted) to be included as one of the expand options. This leads to the question how one could get both the count as well as the references to the individual entities as well as, come to think about it, how one could specify the order in which these references ought to be returned.
In ODATA-339 the proposal is to allow /$count to be appended to a property in the select clause if one wanted to retrieve just the count. I was wondering if $ref should be moved to the select clause as well where $ref became just one of those special properties allowed to be used as appended to a navigation property or in a select nested within an expand were $ref would just be this 'special' property that would result in the reference to be injected in the projection and were it might optionally be combined with other properties (if that made sense)???
I.e. these would then all be valid:
http://host/service.svr/Customers?$select=Orders/$ref
http://host/service.svr/Customers?$select=Orders/$count
http://host/service.svr/Customers?$select=Orders/($select=$ref)
http://host/service.svr/Customers?$select=Orders/($count,$select=$ref,$filter=Amount gt 100)
http://host/service.svr/Customers?$select=Orders/($select=$ref,$orderby=OrderID)