Initial commit - Auth
This commit is contained in:
Executable
+19
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Auth.Contracts.DTOs;
|
||||
using Auth.Contracts;
|
||||
|
||||
namespace Auth.Core.Utility;
|
||||
|
||||
public static class Pagination<T>
|
||||
where T : class
|
||||
{
|
||||
public static IQueryable<T> Paginate(IQueryable<T> query, Pagination pagination)
|
||||
{
|
||||
return query
|
||||
.Skip((pagination.CurrentPage.Value - 1) * pagination.PageSize.Value)
|
||||
.Take(pagination.PageSize.Value);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user