예제 #1
0
        /// <summary>
        /// 将Queryable转换T的集合
        /// </summary>
        /// <typeparam name="T">实体类型</typeparam>
        /// <param name="queryable">查询对象</param>
        /// <returns>T的集合</returns>
        public static List <T> ToList <T>(this Queryable <T> queryable)
        {
            var sbSql  = SqlSugarTool.GetQueryableSql(queryable);
            var reader = queryable.DB.GetReader(sbSql.ToString(), queryable.Params.ToArray());
            var reval  = SqlSugarTool.DataReaderToList <T>(typeof(T), reader, queryable.SelectValue.GetSelectFiles());

            queryable = null;
            sbSql     = null;
            return(reval);
        }