AspNetCoreOData
AspNetCoreOData copied to clipboard
TruncatedCollection does not implement IAsyncEnumerable
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
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?