- Move PaginatedResponse from the single-file Pagination/ folder into Shared/ (namespace Musify.Application.Pagination -> Musify.Application.Shared) - Rename MusifyApplication.cs -> AssemblyInfo.cs (it only holds the [assembly: MediatorOptions] attribute) Build: 0 warnings, 0 errors. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
27 lines
723 B
C#
27 lines
723 B
C#
using X.PagedList;
|
|
|
|
namespace Musify.Application.Shared
|
|
{
|
|
public record PaginatedResponse<T>(
|
|
IReadOnlyCollection<T> Items,
|
|
int PageNumber,
|
|
int PageSize,
|
|
int PageCount,
|
|
int TotalItemCount,
|
|
bool HasNextPage,
|
|
bool HasPreviousPage)
|
|
{
|
|
public static PaginatedResponse<T> FromPagedList(IPagedList<T> pagedList)
|
|
{
|
|
return new PaginatedResponse<T>(
|
|
pagedList.ToArray(),
|
|
pagedList.PageNumber,
|
|
pagedList.PageSize,
|
|
pagedList.PageCount,
|
|
pagedList.TotalItemCount,
|
|
pagedList.HasNextPage,
|
|
pagedList.HasPreviousPage);
|
|
}
|
|
}
|
|
}
|