2024-07-04 11:02:45 +05:00
|
|
|
|
using System.Collections.Generic;
|
2023-07-18 14:41:20 +05:00
|
|
|
|
using System.Linq;
|
2021-04-23 10:21:25 +05:00
|
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
|
namespace AsbCloudApp.Data;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Контейнер для поддержки постраничного просмотра таблиц
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <typeparam name="T"></typeparam>
|
|
|
|
|
public class PaginationContainer<T>
|
2021-04-23 10:21:25 +05:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2024-08-19 10:01:07 +05:00
|
|
|
|
/// конструктор
|
2021-04-23 10:21:25 +05:00
|
|
|
|
/// </summary>
|
2024-08-19 10:01:07 +05:00
|
|
|
|
public PaginationContainer()
|
2021-04-23 10:21:25 +05:00
|
|
|
|
{
|
2024-08-19 10:01:07 +05:00
|
|
|
|
Items = Enumerable.Empty<T>();
|
|
|
|
|
}
|
2021-04-23 10:21:25 +05:00
|
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Кол-во записей пропущенных с начала таблицы в запросе от api
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int Skip { get; set; }
|
2021-04-30 17:35:35 +05:00
|
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Кол-во записей в запросе от api
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int Take { get; set; }
|
2021-04-30 17:35:35 +05:00
|
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Кол-во записей всего в таблице
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int Count { get; set; }
|
2021-04-30 17:35:35 +05:00
|
|
|
|
|
2024-08-19 10:01:07 +05:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Данные
|
|
|
|
|
/// </summary>
|
|
|
|
|
public IEnumerable<T> Items { get; set; }
|
2021-04-23 10:21:25 +05:00
|
|
|
|
}
|