using System; using System.Collections.Generic; namespace Timeline.Models { public class Page { public Page() { } public Page(long pageNumber, long pageSize, long totalCount, List items) { PageNumber = pageNumber; PageSize = pageSize; TotalPageCount = totalCount / PageSize + (totalCount % PageSize != 0 ? 1 : 0); TotalCount = totalCount; Items = items; } public long PageNumber { get; set; } public long PageSize { get; set; } public long TotalPageCount { get; set; } public long TotalCount { get; set; } public List Items { get; set; } = new List(); public Page WithItems(List items) { return new Page(PageNumber, PageSize, TotalCount, items); } } }