Example #1
0
        public List <T> ToPageList <T>(int pageIndex = 1, int pageSize = 10) where T : class
        {
            List <T> result = new List <T>();

            result = llDbContext.Set <T> ().Skip((pageIndex - 1) * pageSize).ToList();
            return(result);
        }
Example #2
0
 /// <summary>
 /// 执行sql
 /// </summary>
 /// <typeparam name="TEntity"></typeparam>
 /// <param name="sql"></param>
 /// <param name="parameters"></param>
 /// <returns></returns>
 public IQueryable <TEntity> FromSql <TEntity>(string sql, params object[] parameters) where TEntity : class => dbContext.Set <TEntity>().FromSql(sql, parameters);