Linq-分页查询

 

                var list = from s in db.t_address
                           select s;
                if (userid != 0 & userid != null)
                {
                    list = list.Where(v => v.userid == userid);
                }
                var pagelist = list.Skip((page - 1) * size).Take(size);//通过分页查询当前页的数据

 

posted @ 2016-06-03 16:32  dekevin  阅读(189)  评论(0编辑  收藏  举报