public PaginationOutputDto GetAll(int page, int pageSize, string sortBy, string sortDirection)
        {
            var entities = _unitOfWork.Customers.GetAll(page, pageSize, sortBy, sortDirection).ToList();

            var pagedRecord = new PaginationOutputDto
            {
                Content      = Mapper.Map <List <CustomerOutputDto> >(entities),
                TotalRecords = _unitOfWork.Customers.CountGetAll(),
                CurrentPage  = page,
                PageSize     = pageSize
            };

            return(pagedRecord);
        }
Example #2
0
        public PaginationOutputDto GetAll(int page, int pageSize, string sortBy, string sortDirection)
        {
            var entities = _productQueries.GetAll(page, pageSize, sortBy, sortDirection).ToList();

            var pagedRecord = new PaginationOutputDto
            {
                Content      = _productCreateAssembler.FromEntityList(entities),
                TotalRecords = _productQueries.CountAll(),
                CurrentPage  = page,
                PageSize     = pageSize
            };

            return(pagedRecord);
        }