2010-08-04 68 views
0

我有两个已被合并的列表。在linq声明的命令之后,我想从完整列表中选择前5个。我正在考虑使用linq语句从列表中选出前5名。从合并列表中选择排名前5(MVC)

var ListSort = from list in NewList 
orderby list.EntryDate 
select list;//Tried to select the top 5 from here 

有关如何做到这一点的任何其他建议?

回答

3

,如果你打算使用LINQ中,然后用Take statement

myList.Take(5)