OData / WebApi

OData Web API: A server library built upon ODataLib and WebApi
https://docs.microsoft.com/odata
Other
855 stars 473 forks source link

[Microsoft.AspNet.OData v7.7.3] Request.ODataProperties().NextLink is always null #2826

Open amanswaika opened 11 months ago

amanswaika commented 11 months ago

Short summary (3-5 sentences) describing the issue.

We recently upgraded to Microsoft.AspNet.OData v7.7.3 from v7.1.0. We have a scenario where we manually update a part of @odata.nextLink before returning it.

We fetch the nextLink using Request.ODataProperties().NextLink and make the neccesarry modifications. However, since the upgrade - Request.ODataProperties().NextLink is always returning null even though the final Api response returns the nextLink (just not in our desired format).

Assemblies affected

Microsoft.AspNet.OData v7.7.3

Code sample -

var data = queryOptions.ApplyTo(queryable, odataQuerySettings, this.IgnoredQueryOptions);

var nextLink = queryOptions.Request.ODataProperties().NextLink;

// The above is always null even though all the queryOptions have applied correctly

But the Api response has the next link present -

image