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);//通过分页查询当前页的数据