Добавил слой Application
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
namespace UniVerse.Application.DTOs.Common;
|
||||
|
||||
public record PaginationRequest(int Page = 1, int PageSize = 20);
|
||||
|
||||
public record PagedResult<T>(
|
||||
List<T> Items,
|
||||
int TotalCount,
|
||||
int Page,
|
||||
int PageSize,
|
||||
int TotalPages
|
||||
)
|
||||
{
|
||||
public static PagedResult<T> Create(List<T> items, int totalCount, int page, int pageSize)
|
||||
{
|
||||
var totalPages = (int)Math.Ceiling(totalCount / (double)pageSize);
|
||||
return new PagedResult<T>(items, totalCount, page, pageSize, totalPages);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user