Which layer should hold pagination information? (Page Size, Page Number), Eg say 100 products, 5 product per 20 pages. User can type in API url layer.
api/Product?Page=1&Limit=2&ColumnSort=Name
Our current architecture is this:
DomainClasses --> (Domain Repository Place in DTO) ---> Business Application Layer --> (Application Method Stored in --> APIs andViewModels
There is a discussion where to hold pagination information, Typical Application can call many repositories. The discussion is going between DTOs and Application layer, just curious what good option is, and standard practice. Should the PagelModel class be in Generic class Application Service, or Generic Class DTO?
public class PageModel
{
public int Page { get; set; }
public int Limit { get; set; }
public string ColumnSort { get; set; }
void BusinessApplicationService() : GeneralApplicationService
{
ProductRepository()
CustomerRepository();
// Combine data etc,
void ProductDTO : GeneralDTO
{
int ProductId {get;set;}
string ProductName {get;set;}
float Amount {get;set;}
code/notes for paging/pagination