1. 程式人生 > >Linq 分頁

Linq 分頁

            ERPDBDataContext erpdb = new ERPDBDataContext(); 
            var List = erpdb.Demand_List.ToList();
            var query = List.OrderByDescending(c => c.Id).OrderByDescending(c => c.Id).ToList();//排序
            var list = (from p in query
                        select p).Skip(10 * (pageNo - 1)).Take(10).ToList();