0

I have a WebApi OData API. I want to perform some pagination. I have managed to fill the nextlink since it exists in OData.

public IQueryable<Product> Get(int min=0,int max=0)
    {
        this.Request.ODataProperties().NextLink = new Uri(Url.ODataLink(
              new EntitySetPathSegment("Products"),
                       new KeyValuePathSegment(Microsoft.Data.OData.Query.ODataUriUtils.ConvertToUriLiteral("100", Microsoft.Data.OData.ODataVersion.V3))
         ));
        ///more code.....
}

The problem is that like I can set the NextLink i want to do the same with a PreviousLink (AtomPub)

Is that possible with OData? How can I create that custom field?

Thanks in advance

X.Otano
  • 2,079
  • 1
  • 22
  • 40
  • I feel like the construction of this URL should be done on the client rather than the server. I think that the next link is really only there to hint that you haven't actually got all of the data and show that there are more pages – TomDoesCode Jul 12 '17 at 09:30
  • Hi, i am implementing atompub, so the clients needs to know there are previous items – X.Otano Jul 12 '17 at 09:38

0 Answers0