Pagination.EntityFrameworkCore.Extensions icon indicating copy to clipboard operation
Pagination.EntityFrameworkCore.Extensions copied to clipboard

[Feature] Consider implement IEnumerable<T> to allow directly iteration

Open NotAsea opened this issue 1 year ago • 1 comments

I instinctively thought Pagination as IEnumerable and try to foreach it only to realise it just a class holding actual Results in it, so why dont we directly implement IEnumerable for it some thing like

public class Pagination<TSource> : IEnumerable<TSource>
{
    // other Properties
    public IEnumerator<TSource> GetEnumerator() => Results.GetEnumerator();
    IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
}

NotAsea avatar Jul 17 '24 16:07 NotAsea