public static PaginationViewModel <T> Build(IEnumerable <T> items, ApiParameters apiParameters, int totalCount) { var paginationViewModel = new PaginationViewModel <T> { _items = items.ToList() }; paginationViewModel.SetPaginationState(totalCount, apiParameters); return(paginationViewModel); }
public static PaginationViewModel <T> Build(IEnumerable <T> items) { var paginationViewModel = new PaginationViewModel <T> { _items = items.ToList() }; paginationViewModel.SetPaginationState(items.Count(), 1, items.Count()); return(paginationViewModel); }
public PaginationViewModel <E> Mutate <E>(Func <T, E> mutator) { var paginationViewModel = new PaginationViewModel <E> { Pagination = Pagination }; if (_items != null) { paginationViewModel._items = _items.Select(mutator).ToList(); } return(paginationViewModel); }
public PaginationViewModel(PaginationViewModel <T> paginationViewModel) { _items = paginationViewModel._items; Pagination = paginationViewModel.Pagination; }