//总条数
var totalCount=query.Count;
//总页数
var totalPage=totalCount%model.PageSize==0?totalCount/model.PageSize:totalCount/model.PageSize+1
if(totalPage>=model.PageIndex){
query=query.Skip((model.PageIndex-1)*model.PageSize)).Take(model.PageSize)
}else{
query=null
}