public void PagingSql_Test() { var sqlQuery = "SELECT ID AS Num, Name, Age, Weight, Address, Enabled, CreatedDate FROM TestTemp"; var pagingSql = new SqlSelectPagingClauseBuilder(sqlQuery, 2, 6); var result = pagingSql.ToString(); Assert.Fail(result); }
/// <summary> /// 获取在存储容器中的对象集合, 若没有数据,则返回空的集合(非 null) /// </summary> /// <typeparam name="T">要查询的实体类型</typeparam> /// <param name="sqlQuery">SQL 查询语句 /// 注:用具体的列名,不要使用 * 匹配符</param> /// <param name="start">分页起始数</param> /// <param name="count">每页的数量</param> /// <param name="param">查询参数</param> /// <returns><c>T</c>集合</returns> public IEnumerable <T> Select <T>(string sqlQuery, int start, int count, object param = null) { var sqlBuilder = new SqlSelectPagingClauseBuilder(sqlQuery, start, count); return(this.Select <T>(sqlBuilder.ToString(), param)); }
/// <summary> /// 获取 DataReader 对象 /// 在关闭 DataReader 时,也会同时关闭对数据库的连接 /// </summary> /// <param name="sqlQuery">SQL 查询语句 /// 注:用具体的列名,不要使用 * 匹配符</param> /// <param name="start">分页起始数</param> /// <param name="count">每页的数量</param> /// <param name="param">查询参数</param> /// <returns><see cref="System.Data.Common.DbDataReader"/></returns> public IDataReader GetDataReader(string sqlQuery, int start, int count, object param = null) { var sqlBuilder = new SqlSelectPagingClauseBuilder(sqlQuery, start, count); return(this.GetDataReader(sqlBuilder.ToString(), param)); }