Linq-查询上一条下一条

//下一条  
int pollid = poll.Where(f => f.PollID < CurrentId).OrderByDescending(o => o.PollID).FirstOrDefault().PollID;  
 
//上一条 
int pollid = poll.Where(f => f.PollID > CurrentId).OrderByDescending(o => o.PollID).FirstOrDefault().PollID;   

 

posted @ 2016-07-13 15:49  dekevin  阅读(995)  评论(1编辑  收藏  举报