/// <summary> /// Returns the query for getting the total number of rows, /// subclasses can override this for custom behaviour. /// </summary> protected internal virtual string GetCountQuery() { if (dbConf.GetInputCountQuery() != null) { return(dbConf.GetInputCountQuery()); } StringBuilder query = new StringBuilder(); query.Append("SELECT COUNT(*) FROM " + tableName); if (conditions != null && conditions.Length > 0) { query.Append(" WHERE " + conditions); } return(query.ToString()); }