public async Task<IList<WishlistItemDto>> GetAllAsync(PageInfo pageInfo)
{
if (pageInfo.Page <= 0 || pageInfo.ItemsPerPage <= 0)
{
pageInfo.Page = 1;
pageInfo.ItemsPerPage = 1;
}
int pageSize = 10;
int pageNumber = (pageInfo.Page - 1) * pageInfo.ItemsPerPage;
var items = await _wishListItemRepository.GetAllAsync(pageNumber, pageSize);
var reversedList = (List<WishlistItemDto>)_mapper.Map<IList<WishlistItemDto>>(items);
reversedList.Reverse();
return reversedList;
}
public async Task<IList<WishlistItemDto>> GetAllAsync(PageInfo pageInfo)
{
var items = await _wishListItemRepository.GetAllAsync(pageInfo.Offset(), pageInfo.Limit());
return _mapper.Map<IList<WishlistItemDto>>(items).Reverse().ToList();
}