Пример #1
0
        /// <summary>
        /// 按select返回匿名对象
        /// </summary>
        /// <typeparam name="TResult"></typeparam>
        /// <param name="resultSelector"></param>
        /// <returns></returns>
        public List <TResult> ToDynamic <TResult>(Expression <Func <T, TResult> > resultSelector)
        {
            //只能做到当前对象筛选
            var db = new DBExtend(__DbContext);

            return(db.QueryDynamic(this, resultSelector));
        }
Пример #2
0
        /// <summary>
        /// 返回动态对象
        /// 会按GROUP和分页判断
        /// </summary>
        /// <returns></returns>
        public List <dynamic> ToDynamic()
        {
            var db = new DBExtend(__DbContext);

            if (__PageSize > 0)
            {
                return(db.Page(this));
            }
            return(db.QueryDynamic(this));
        }
Пример #3
0
        /// <summary>
        /// 返回指定类型
        /// 会按GROUP和分页判断
        /// </summary>
        /// <typeparam name="TResult"></typeparam>
        /// <returns></returns>
        public List <TResult> ToList <TResult>()
            where TResult : class, new()
        {
            var db = new DBExtend(__DbContext);

            if (__PageSize > 0)
            {
                return(db.Page <T, TResult>(this));
            }
            return(db.QueryDynamic <T, TResult>(this));
        }