Reputation: 57
How to modify this query to be able to select the 5 most recent records sorted by title?
IEnumerable<Story> recentStories =
(from s in stories
orderby s.Date descending
select s).Take(5);
Upvotes: 1
Views: 860
Reputation: 44298
IEnumerable<Story> recentStories =
(from s in stories
orderby s.Date descending
select s).Take(5).OrderBy(s => s.Title);
Upvotes: 3