Initial DeepDrft Models Project

- Track Entity & DTO
 - Paging models
This commit is contained in:
2025-08-30 21:43:15 -04:00
parent c86632e979
commit aac0004e03
5 changed files with 99 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
using System.Linq.Expressions;
namespace DeepDrftModels.Models;
public class PagingParameters
{
private const int _maxPageSize = 100;
private int _pageSize = 20;
public int Page { get; set; } = 1;
public int PageSize
{
get => _pageSize;
set => _pageSize = value > _maxPageSize ? _maxPageSize : value;
}
}
public class PagingParameters<T> : PagingParameters
{
public Expression<Func<T, object>>? OrderBy { get; set; }
public bool IsDescending { get; set; } = false;
public int Skip => (Page - 1) * PageSize;
}