BotSharp/src/Infrastructure/BotSharp.Abstraction/Utilities/Pagination.cs

18 lines
392 B
C#
Raw Normal View History

2023-12-04 23:42:46 +00:00
namespace BotSharp.Abstraction.Utilities;
public class Pagination
{
2024-01-18 05:23:20 +00:00
public int Page { get; set; } = 1;
2023-12-04 23:42:46 +00:00
/// <summary>
/// Use -1 for all records
/// </summary>
public int Size { get; set; } = 20;
2024-01-18 05:23:20 +00:00
public int Offset => (Page - 1) * Size;
2023-12-04 23:42:46 +00:00
}
public class PagedItems<T>
{
public int Count { get; set; }
2024-02-04 05:42:13 +00:00
public IEnumerable<T> Items { get; set; } = new List<T>();
2023-12-04 23:42:46 +00:00
}