public List <CustomMember> GetMembers(int pageIndex, int pageSize, out int totalRecords) { totalRecords = _db.ExecuteScalar <int>("SELECT Count(*) FROM CustomMembers"); var members = _db.SkipTake <CustomMember>(pageIndex * pageSize, pageSize, "SELECT * FROM CustomMembers"); return(members); }