OData / OData/AspNetCoreOData

TruncatedCollection does not implement IAsyncEnumerable

Open
#253 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

The code below will fail:

var settings = new ODataQuerySettings() { PageSize = 10 };
var items = await query.ApplyTo(data, settings).Cast<object>().ToListAsync(ct);

Exception:
The source 'IQueryable' doesn't implement 'IAsyncEnumerable<System.Object>'. Only sources that implement 'IAsyncEnumerable' can be used for Entity Framework asynchronous operations.

The issue is:
TruncatedCollection (which is used when PageSize is provided) does not implement IAsyncEnumerable

Version: 8.0.1

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.

Research direction

Locate TruncatedCollection and trace the ApplyTo path when ODataQuerySettings.PageSize is set. Reproduce the shown Cast().ToListAsync(ct) case, then verify that the paged result supports Entity Framework asynchronous enumeration and the exception no longer occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, backend-api-design
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.