hope you can help me out here. I have a list of Bookings where I would like to get the top 2 rows in each group of TourOperators.
here\'s a sample of the data:
Try to use var and replace First() with Take(2):
var
First()
Take(2)
var yetAnotherList = list.GroupBy(row => row.TourOperator) .Select(g => g.OrderBy(row => row.DepDate).Take(2)).ToList();