public static IDataReader ExecuteReader(this ISqlQuery sqlQuery, DbGateway dbGateway, int pageNumber, int pageSize) { string commandSql = sqlQuery.SqlBuilder.GetQuerySql(); object[] paramValues = sqlQuery.SqlBuilder.GetParameters().Values.ToArray(); return(dbGateway.ExecuteReader(commandSql, paramValues)); }