Search code examples
odataodatalib

Does OData lib support @odata.nextLink on expanded feeds?


I am using ODataLib to parse OData V4 feeds and entries. One of the OData feeds returns payload with expanded associations that look like this:

{
  "@odata.context":"https://myfeed.com/api/data/v8.1/$metadata#accounts(name,Account_Tasks)","value":[
    {
      "@odata.etag":"W/\"596351\"","name":"Account 1","accountid":"5f4c87e4-4952-e611-80dd-c4346bacfc18","Account_Tasks":[

      ],"Account_Tasks@odata.nextLink":"https://myfeed.com/api/data/v8.1/accounts(5f4c87e4-4952-e611-80dd-c4346bacfc18)/Account_Tasks"
    }
  ]
}

Note the element "Account_Tasks@odata.nextLink": it provides the link to expanded data. But none of ODataLib classes seems to expose this property.

Is this property exposed by ODataLib or it's not currently supported?


Solution

  • It is supported in ODL, you can find it in

    https://github.com/OData/odata.net/blob/ODataV4-6.x/src/Microsoft.OData.Core/ODataFeedBase.cs#L49-L65

        public Uri NextPageLink 
        {
            get
            {
                return this.nextPageLink;
            }
    
            set
            {
                if (this.DeltaLink != null && value != null)
                {
                    throw new ODataException(ODataErrorStrings.ODataFeed_MustNotContainBothNextPageLinkAndDeltaLink);
                }
    
                this.nextPageLink = value;
            }
        }