Relatude Help

Paging

.Page(int pageIndex0based, int pageSize)
.Take(int maxCount)
.Skip(int offset)

Page(p, n) returns the same rows as .Skip(p * n).Take(n) and also records the page in the result. Either way, TotalCount is the number of matches before paging, so one query gives you both the page and the total. Use Page for pagination:

var page = db.Query<IEvent>()
             .Where(e => e.Status == EventStatus.Published)
             .OrderBy(e => e.StartsUtc)
             .Page(2, 25)                       // the third page of 25
             .Execute();

Console.WriteLine($"{page.Count} of {page.TotalCount} events in {page.DurationMs:0.0} ms");