locked
$top on $expand parts? RRS feed

  • Question

  • Hi all;

    Is there a way to apply $top so that not only the base entry is limited to 1 entry ($top=1) but that any feed due to the $expand limits that feed's entries to 1 entry?

    I have a point where I need just 1 of everything to build up the structure of what can be returned to display as a metadata tree.

    thanks - dave


    Who will win The International Collegiate Programming Championships?

    Wednesday, September 12, 2012 10:33 PM

Answers

  • Hi,

    No - there's no way to apply query options other than $select to expanded navigation properties.

    Thanks,


    Vitek Karas [MSFT]

    • Marked as answer by DavidThielen Thursday, September 13, 2012 4:21 PM
    Thursday, September 13, 2012 7:50 AM
    Moderator

All replies

  • Hi,

    No - there's no way to apply query options other than $select to expanded navigation properties.

    Thanks,


    Vitek Karas [MSFT]

    • Marked as answer by DavidThielen Thursday, September 13, 2012 4:21 PM
    Thursday, September 13, 2012 7:50 AM
    Moderator
  • Hi Vitek;

    Ok, my first suggestion for the OData API. It would be really useful to have a $metadataonly command that can be added to any select. That would then return the metadata of a select, but no actual data.

    Theoretically this could be built from the EDM and parsing the select, but that is also an approach where I (and any other programmer) could miss something and we're then wrong. Or I write a perfect metdata extractor for version 3 - and someone uses a version 4 construct in a select and I then have the wrong metadata. It's also something that will be needed by many so better to put it up on the server.

    ??? - thanks - dave


    Who will win The International Collegiate Programming Championships?

    Thursday, September 13, 2012 4:21 PM
  • Hi,

    Please use this site: http://data.uservoice.com/forums/72027-wcf-data-services-feature-suggestions for feature suggestions. It allows others to vote on it and will give us a better sense of the importance and priority.

    Note that the ODataLib.Contrib project contains a URL parser which will expose this kind of information...

    Thanks,


    Vitek Karas [MSFT]

    Thursday, September 13, 2012 4:42 PM
    Moderator
  • Thursday, September 13, 2012 5:45 PM