From e3581468ba974f40b45b9a5fa76e6e6495d194ac Mon Sep 17 00:00:00 2001 From: Derek Stegelman Date: Tue, 12 Mar 2024 12:55:31 -0600 Subject: [PATCH 1/2] Paged Resource list Model --- .../CsuChhs.WebComponents.csproj | 2 +- .../ResourceModels/PagedResourceListBase.cs | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 CsuChhs.WebComponents/ResourceModels/PagedResourceListBase.cs diff --git a/CsuChhs.WebComponents/CsuChhs.WebComponents.csproj b/CsuChhs.WebComponents/CsuChhs.WebComponents.csproj index 16b98ec..085fa62 100644 --- a/CsuChhs.WebComponents/CsuChhs.WebComponents.csproj +++ b/CsuChhs.WebComponents/CsuChhs.WebComponents.csproj @@ -6,7 +6,7 @@ enable true CHHS Application Development Team - 1.0.0 + 1.0.1 https://github.com/csu-chhs/CsuChhs.WebComponents College of Health and Human Sciences CsuChhs.WebComponents diff --git a/CsuChhs.WebComponents/ResourceModels/PagedResourceListBase.cs b/CsuChhs.WebComponents/ResourceModels/PagedResourceListBase.cs new file mode 100644 index 0000000..7a77abd --- /dev/null +++ b/CsuChhs.WebComponents/ResourceModels/PagedResourceListBase.cs @@ -0,0 +1,23 @@ +namespace CsuChhs.WebComponents.ResourceModels +{ + public class PagedResourceListBase + { + public PagedResourceListBase(int take, + int page, + int totalCollectionCount) + { + Items = new(); + CurrentPage = page; + Take = take; + Skip = (CurrentPage * take) - take; + } + + public int CurrentPage { get; set; } + public int Take { get; set; } + public int Skip { get; set; } + public int TotalCollectionCount { get; set; } + + public int TotalPages => (TotalCollectionCount + Take - 1) / Take; + List Items { get; set; } + } +} From 7b96b2872ed114ab62be6b696e2361ad3013d4bd Mon Sep 17 00:00:00 2001 From: Derek Stegelman Date: Tue, 12 Mar 2024 13:26:39 -0600 Subject: [PATCH 2/2] Update CsuChhs.WebComponents.csproj --- CsuChhs.WebComponents/CsuChhs.WebComponents.csproj | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CsuChhs.WebComponents/CsuChhs.WebComponents.csproj b/CsuChhs.WebComponents/CsuChhs.WebComponents.csproj index 085fa62..08b597b 100644 --- a/CsuChhs.WebComponents/CsuChhs.WebComponents.csproj +++ b/CsuChhs.WebComponents/CsuChhs.WebComponents.csproj @@ -16,8 +16,10 @@ README.md - - - + + + + +