TotalCountFunc evaluated before IQueryable is enumerated
Open
@gathogojr is already working on this.
Since Mar 15, 2022.
bug
regression
- Dominant language
- C#
- Stars
- 505
- Forks
- 186
- PR merge metrics
- No merged PRs in 30d
Description
ODataResourceSetSerializer.CreateResourceSet executes the TotalCountFunc, but that is called before the IQueryable is evaluated in ODataResourceSetSerializer.WriteResourceSetAsync and thus the TotalCountFunc can never know anything about what filters were requested, and thus always returns the wrong result when using TotalCountFunc.
resourceSetInstance.GetEnumerator() MUST be called before executing TotalCountFunc!
This is a critical problem.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.