日期:2014-05-20 浏览次数:20709 次
IQueryable<NewsInfo> queryable = (from c in this.db.NewsInfo
where c.SmallId == 9 //这里我要查询:9,10,11,12,13多个ID,怎么写? orderby c.id descending
select c).Take<NewsInfo>(itop);
IQueryable<NewsInfo> queryable = (from c in this.db.NewsInfo.
where "9,10,11,12,13".Split(',').Contains(c.SmallId) orderby c.id descending
select c).Take<NewsInfo>(itop);
IQueryable<NewsInfo> queryable = (from c in this.db.NewsInfo
where new int[] { 9,10,11,12,13 }.Contains(dt.Field<Int32>("SmallId "))
orderby c.id descending
select c).Take<NewsInfo>(itop);
IQueryable<NewsInfo> queryable = this.db.NewsInfo.Where(c => new int[] { 9, 10, 11, 12, 13 }.Contains(c.SmallId)).Take<NewsInfo>(itop);