22 lines
715 B
C#
22 lines
715 B
C#
// using System;
|
|
// using System.Collections.Generic;
|
|
// using System.Linq;
|
|
// using System.Threading.Tasks;
|
|
// using Contracts.DTOs;
|
|
// using Contracts.DTOs.Generic;
|
|
|
|
// namespace Commerce.Core.Utility;
|
|
// public static class PaginationExtension
|
|
// {
|
|
// public static IQueryable<T> Paginate<T>(this IQueryable<T> query, Pagination pagination)
|
|
// {
|
|
// if (pagination.CurrentPage.HasValue && pagination.PageSize.HasValue)
|
|
// return query
|
|
// .Skip((pagination.CurrentPage.Value - 1) * pagination.PageSize.Value)
|
|
// .Take(pagination.PageSize.Value);
|
|
// else
|
|
// return query;
|
|
// }
|
|
// }
|
|
|