You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let pageItems pageSize pageIndex items =
let totalItems = Seq.length items
let totalPages = (totalItems + pageSize - 1) / pageSize
let pagedItems =
items
|> Seq.skip (pageIndex * pageSize)
|> Seq.take pageSize
|> Seq.toList // Convert to list here if necessary, or adjust return type to seq<'T> if keeping as sequence is preferred
{ Items = pagedItems; TotalItems = totalItems; TotalPages = totalPages }
type PagedResult<'T> = {
Items: 'T list
TotalItems: int
TotalPages: int
}
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: