using X.PagedList; namespace Musify.Application.Shared { public record PaginatedResponse( IReadOnlyCollection Items, int PageNumber, int PageSize, int PageCount, int TotalItemCount, bool HasNextPage, bool HasPreviousPage) { public static PaginatedResponse FromPagedList(IPagedList pagedList) { return new PaginatedResponse( pagedList.ToArray(), pagedList.PageNumber, pagedList.PageSize, pagedList.PageCount, pagedList.TotalItemCount, pagedList.HasNextPage, pagedList.HasPreviousPage); } } }