OData / OData/AspNetCoreOData

SkipToken returning invalid next link when combined with select

Open
#616 7 comments 1 reaction 1 assignee View on GitHub

@xuzhg is already working on this.

Since Jun 14, 2022.

follow-up investigating
Dominant language
C#
Stars
505
Forks
186
PR merge metrics
No merged PRs in 30d

Description

Hi team,
we are using AspNetCore.Odata 8.0.8 for a simple get api with paging.
the Default paging uses Skip - which is causing us regressions with EFC (inefficient query)

in order to improve the performance, we are trying to use SkipToken for generating the next page link instead.

we added the skip token this way:

AddOData(opt =>
                {
                    var edmModel = GetEdmModel();
                    opt.AddRouteComponents("api", edmModel, ConfigureODataServices).SkipToken();
                    opt.RouteOptions.EnableNonParenthesisForEmptyParameterFunction = true;
                });

this works perfectly when sending a simple get request, however, when the request has a select filter
for example: http://localhost:1059/api/Machines?$select=id

the next link is: "@odata.nextLink": "https://localhost:1059/api/Machines?$select=id&$skiptoken=id-null"

can you help in investigating this bug?

Best,
Nader.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.