Pagination.EntityFrameworkCore.Extensions
Pagination.EntityFrameworkCore.Extensions copied to clipboard
[Feature] Consider implement IEnumerable<T> to allow directly iteration
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();
}