日期:2014-05-20  浏览次数:20650 次

(linq)这句用lambda表达式怎么写
C# code

// select * from tb where id in (select min(id) as id from tb group by pdt_id )


WeblogContext db = new WeblogContext();

IEnumerable<Article> Articles = db.Articles.  ??????????




后面咋写??

------解决方案--------------------
db.Articles.Select(v=>xxxxxxxx)
------解决方案--------------------
select * from tb where id in (select min(id) as id from tb group by pdt_id )

var result = db.Articles.GroupBy(x => x.pdt_id).Select(x => x.OrderBy(y => y.id).First());