Skip to content

TruncatedCollection does not implement IAsyncEnumerable #253

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
dsidedp opened this issue Jul 25, 2021 · 1 comment
Open

TruncatedCollection does not implement IAsyncEnumerable #253

dsidedp opened this issue Jul 25, 2021 · 1 comment

Comments

@dsidedp
Copy link

dsidedp commented Jul 25, 2021

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

@Xriuk
Copy link

Xriuk commented Nov 12, 2024

TruncatedCollection cannot implement IAsyncEnumerable<T> because it inherits from List<T>, but I wonder why it works this way. Is there not a way to paginate elements via IQueryable<T> like it happens with $expand and $select which have their own wrappers?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants