public static async Task <IPagedList <T> > Create(IQueryable <T> superset, int pageNumber, int pageSize) { var list = new AsyncPagedList <T>(); await list.Init(superset, pageNumber, pageSize); return(list); }
/// <summary> /// Creates a subset of this collection of objects that can be individually accessed by index and containing metadata about the collection of objects the subset was created from. /// </summary> /// <typeparam name="T">The type of object the collection should contain.</typeparam> /// <param name="superset">The collection of objects to be divided into subsets. If the collection implements <see cref="IQueryable{T}"/>, it will be treated as such.</param> /// <param name="pageNumber">The one-based index of the subset of objects to be contained by this instance.</param> /// <param name="pageSize">The maximum size of any individual subset.</param> /// <returns>A subset of this collection of objects that can be individually accessed by index and containing metadata about the collection of objects the subset was created from.</returns> /// <seealso cref="AsyncPagedList{T}"/> public static async Task <IPagedList <T> > ToPagedListAsync <T>(this IQueryable <T> superset, int pageNumber, int pageSize) { return(await AsyncPagedList <T> .Create(superset, pageNumber, pageSize)); }